In a globalized world, everything fluid in a nation seems to ebb and flow through its borders, connected through trade, culture, information, and conflict. Everything but human beings, it seems. Immigrants of developing or poorer nations remain stagnant, subject to crushing bureaucracy and harsh prejudice.

Immigration reform is a tender subject and remains a hot topic for politicians and presidential hopefuls, with members of opposing parties pulling at opposite ends of the argument: open the borders or thicken those already bold lines, which are seemingly arbitrarily strewn about atlases and geography textbooks the world over. Where once wars were waged to push them farther toward ports or rivers, today, policy is waged to keep them rigid and sealed.

However, Judge Dolly Gee, of the U.S. District Court for the Central District of California, has recently taken a step humanitarians have heralded as golden. The New York Times reported on July 25 that Gee has ordered the release of a number of children and their mothers detained after being caught illegally crossing the Mexico-U.S. border. The conditions in which these children were being held were in violation of a long-standing 1997 court settlement, which explicitly detailed the living conditions required for facilities housing detained children. She described these conditions as “deplorable.”

Approximately 1,700 parents, along with their children, are detained at three detention centers, two of which in south Texas and the third 2,000 miles from the border in Pennsylvania, according the Los Angeles Times.

Though the 1997 decision pertained to minors caught in absence of their parents or guardians, Gee believes the ruling should extend to mothers who are detained with their children as well.

Imprisoning children tends to be a cut-and-dried “no-no” for civilized society, but Marsha Canton, a spokeswoman for the Department of Homeland Security, said officials are disappointed with the court ruling. Gee has given the Homeland Security until Aug. 3 to explain why her order should not be implemented within 90 days.

More than 57,000 children were detained along the Southwest border in 2014, according to U.S. Customs and Borders Protection. Illegal immigration shows some signs of slowing down, as a little fewer than 27,000 children have been apprehended so far this year (up to the end of June).

However, in response to the surge in border crossings, Homeland Security Secretary Jeh Johnson ordered a dramatic expansion of detention beds.

This reactionary knee-jerk response to the upswing in border crossings, though, has led to the less-than-ideal detention camps, or prisons, essentially , that South and Central American families find themselves housed in.

Not only does this detention of humans compromise U.S. humanitarian ideals, it’s expensive. According to Reuters, “If all non-criminal detainees were moved to community-based alternative forms of supervision, the government could save up to $1.6 billion a year.”

Perhaps instead of juggling labor prospects between borders, immigration officials could streamline legal immigration policies. But perhaps open borders will always remain a hard subject, as even the progressive Sen. Bernie Sanders, I-Vt., makes a strong point when he states that employing the swaths of jobless young people ought to take precedence over opening borders.

But until then, maybe solutions outside of detaining and imprisoning children should take precedence over that.