DALLAS (AP) — A federal appeals court has struck down dozens of measures ordered by a judge to improve Texas’ foster care system, but the court said the state must still make improvements.

The 5th U.S. Circuit Court of Appeals issued the ruling Thursday in a years-long case focused on children in the state’s long-term care.

U.S. District Judge Janis Graham Jack had ordered sweeping changes earlier this year, ruling that the state’s system was unconstitutionally broken. She said children labeled permanent wards of the state “almost uniformly leave state custody more damaged than when they entered.”

The state quickly appealed Jack’s ruling.

The appeals court judges said they agreed with Jack’s frustration with the state failing to fix problems and that “remedial action is appropriate.” But the judges said her order went “well beyond” what’s necessary for constitutional compliance.

(© Copyright 2018 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)