MURRYSVILLE (KDKA) — A former teacher in the Franklin Regional School District is now headed to trial on charges he sent inappropriate text messages to a student.

Terry Flaherty, 58, is accused of sending the text message back in November, asking him to send an inappropriate photo and telling him the photo would cover a $100 debt that he owed.

READ MORE: PHOTO GALLERY: Fern Hollow Bridge Collapses In Pittsburgh's Frick Park

When the child refused, Flaherty allegedly apologized and claimed he was drunk at the time.

Defense attorney Duke George says that Flaherty became acquainted with the alleged victim through a program that helps students who are victims of bullying.

READ MORE: Frick Park Bridge Collapse: 10 Minor Injuries Reported, 3 People Taken To Hospital

The student was one of many who had Flaherty’s cell phone number so that he could communicate with him when needed.

Flaherty adamantly denies that he sent the text messages to the student. His attorney says the messages may have been sent from Flaherty’s phone, but evidence will show the messages were sent by someone else.

Flaherty retired from the Franklin Regional School District after charges were filed last month.

A district judge changed the terms of Flaherty’s bond. Previously, he wasn’t allowed to speak with other teachers in the district and now he will be allowed to do so.

MORE NEWS: 'It Sounded Like A Huge Snowplow:' Neighbors Recall Sights And Sounds From Pittsburgh Bridge Collapse

He’s scheduled to be back in court for a formal arraignment in March.