CHICAGO (AP) — An Illinois appeals court has reversed a trial judge’s ruling that a convicted child molester and defrocked priest can be held longer than his sentence.

According to court records filed Tuesday, a three-judge panel of the Illinois First District Appellate Court ruled Cook County prosecutors failed to prove Daniel McCormack’s mental disorder would likely cause him to re-offend.

McCormack completed his five-year sentence in 2009 for molesting five boys in Chicago’s St. Agatha’s Roman Catholic parish. He has been in state custody since.

Judge Dennis Porter in 2017 declared McCormack a sexually violent person who should remain indefinitely in a state facility for sex offenders.