Hundreds of migrant children, most from Central America, are spending days warehoused in vast facilities in Nogales, Ariz., and Texas, waiting as their immigration cases are processed and relatives are found.

They are the human evidence of a patchwork U.S. immigration policy that has conveyed contradictory messages and has not kept up with the changing realities of skyrocketing violence in Central America.

For example, 20,000 unaccompanied children from El Salvador, Honduras and Guatemala were caught at the U.S. border last year — up from 10,000 the year before. The trend didn’t erupt overnight.

The Obama administration is finally taking action to try to stem the tide of migrants where it begins. The Department of Homeland Security said last week that it will open more facilities for families and children so it can detain and deport more migrants, instead of continuing the common practice of releasing them into the U.S. to await an immigration court date.

Officials hope that the move will dispel rumors rampant in Central America that if you try to illegally enter the U.S. with a child, or if you’re a child traveling alone, federal authorities will give you a permit to stay.

The rumors aren’t true, but for years the situation hasn’t been that far off. The U.S. hasn’t had detention facilities to house families and children, so authorities did release them in the U.S. on their own recognizance.

The undocumented migrants didn’t have permission to be in the country, but it was close enough for people fleeing widespread violence and joblessness in their home country.

The U.S. has begun a public-relations effort in Central American countries to spread the word that migrants will be detained and deported. Vice President Joe Biden visited the region last week carrying an Obama administration pledge of $93 million for anti-poverty and anti-gang programs in Guatemala, El Salvador and Honduras.

“We’re approaching this issue with a shared recognition that the current situation is not sustainable. It is unacceptable. And we have a shared responsibility to take significant steps to address this issue,” Biden said after meeting with Guatamalan President Otto Perez Molina. “But I want to make clear, Mr. President, the United States recognizes that a key part of the solution to this problem is to address the root causes of this immigration in the first place. Especially poverty, insecurity and the lack of the rule of law.”

While such factors do push people toward the U.S. in search of safety and opportunity, it’s naïve to think that a fractured U.S. immigration policy plays no part in the decision to risk the dangerous journey north.

Creating a pathway to legal status for unauthorized immigrants already in the country and constructing a way for people to legally come and work is the only way to stem the tide of migrants trying to enter the U.S. any way they can.