When federal authorities place immigrant children living in Illinois, Wisconsin and across the United States in detainment, those children have a right to challenge the decision and understand the reasoning behind it. So says the 9th U.S. Circuit Court of Appeals, according to NBC Chicago, which recently ruled that immigrant children who do not have parents who reside in the country still have a right to a court hearing.

Currently, immigration advocates believe there are several hundred immigrant children in secure custody, and that denying these children a right to hearing, and therefore leaving the length of the detention up for debate, can have serious psychological effects. The U.S. Department of Justice also noted in 2016 that immigration judges frequently lack the knowledge and education necessary to make determinations about what it is best for an immigrant child. The organization suggested that the job is perhaps better left to those within the U.S. Department of Health and Human Services.

The New York Times noted that the three judges who ruled that detained immigrant children have a right to court hearings referenced the Flores settlement, a 1997 decision that ruled that minors held in immigrant custody must have bond hearings before immigration judges. Immigration advocates applaud the ruling, noting that it gives them the ability to advocate on behalf of these children while challenging potentially overzealous actions taken by law enforcement officials.

The ruling comes in the wake of challenges put forth by federal government officials, who argued that laws passed in 2002 and 2008 eliminated an immigrant child’s right to a court hearing. Should the ruling stand, the government will likely see its existing backlog of immigration cases grow considerably larger.