NEW YORK (PIX11) — New York City avoided a federal takeover of the Rikers Island jail complex during a Tuesday hearing.

The city had been given weeks to come up with an improvement plan. Problems have plagued Rikers for years, but Mayor Eric Adams expressed confidence in Department of Correction Commissioner Louis Molina to fix the troubled jail.

“I am absolutely confident that this administration can deliver what it takes to create a safe and humane jail system for all who work and live in our jails,” Molina said after Tuesday’s hearing. “We have been working tirelessly to overcome years of neglect by previous administrations, taking bold steps, and we are starting to see data-driven results in several key safety and security indicators.”

Federal judge Laura Swain called for the city to submit a revised plan by June 10. Molina said his goal for that say is “all parties moving forward with confidence that results will be delivered.”

He’s had to work on the plan while dealing with deaths at Rikers. So far this year, five detainees have died while in DOC cusotody.

Just days ago, a Bronx judge held the DOC in contempt of court for failing to prove that incarcerated people are being taken to doctor’s appointments. If the DOC doesn’t show proof of that within the next few weeks, it could face thousands in fines.

A spokesperson for the Legal Aid Society, which represents many detainees at Rikers, declined to comment. PIX11 reached out to a spokesperson for the union representing correction officers for comment.

PIX11’s Katie Corrado contributed to this report.