PHILADELPHIA – A fired Philadelphia teacher with a penchant for cursing and talking about sex with students was reinstated with back pay after a judge reversed his termination because school officials didn’t follow proper procedures.

Commonwealth Court Judge Anne E. Covey wrote in an opinion that the court “does not condone” the conduct of former Jules E. Mastbaum Area Vocational Technical School teacher Ellis Jones, but it is “duty bound” to reinstate him “until the district properly terminates his employment in accordance with the School Code,” PennLive.com reports.

MORE NEWS: Know These Before Moving From Cyprus To The UK

The School District of Philadelphia terminated Jones in August 2009 without a full, mandatory hearing mandated by the Public School Code for tenured teachers for “speaking unprofessionally to his students, including using foul language and inappropriate discussion topics such as sex,” according to court documents cited by the news site.

Assistant teachers, tutors, mentors, and students in Jones’ class confirmed the teacher’s misconduct, and Jones himself “admitted to making some statements, but asserted that they were taken out of context and were misrepresented in others. He also maintained that he was trying to create an atmosphere of rapport with his students,” Covey wrote.

Jones appealed his termination and former State Education Secretary Carolyn Dumaresque ordered him to be temporarily reinstated for 14-months, a ruling that was appealed by both the district and Jones in 2013, which prompted the review by a Commonwealth Court panel, PennLive reports.

According to the site:

As a tenured teacher, Jones was entitled to the full disciplinary review required by the School Code, Covey wrote. Instead, she noted, he was fired in August 2009 without first having a mandatory hearing where he could defend himself. Such a hearing was held, but only eight months after his pay was stopped, Covey added, and another seven months passed before his “illegal” termination was ratified by district officials.

Covey and other judges on the panel ordered the state education secretary to determine how much the school district owes Jones in back pay, and to reinstate the teacher, though the ruling does not preclude the district from terminating his employment through the proper procedures.

Several folks who commented about the situation online were clearly not impressed with the panel’s ruling.

MORE NEWS: How to prepare for face-to-face classes

“Get rid of unions so we can get rid of lousy teachers,” readon2 wrote. “There was a time they were needed. Not so much anymore.”

“This is why we need more money for education?” Thomas Medicine questioned.

“How about they just do like they do in NYC, since they have to keep him on the payroll – stick him in an office somewhere in the board of education building and have him do filing,” Andrea DiMaggio wrote. “There he can swear and talk about sex all he likes while building a rapport with paperwork.”