Ahead of a major vote on a US plan to reform its immigration system, one of its Republican authors is worried that it doesn’t do enough to secure the border. If it became law, the government would hire more border patrollers, build new bases for them and fund the construction of more walls. It even hires more judges and prosecutors to deport anyone who is detained.

Instead, the bill’s shortcomings have less to do with securing the border and more to do with boosting the Mexican economy, which would reduce the number of future unauthorized immigrants. Here’s why:

Border crossings are getting choked

The North American Free Trade Agreement, which went into effect in 1994, led to a massive increase in trade between the US and Mexico as businesses in the two countries integrated their supply chains. But the US government estimates a $6 billion deficit in infrastructure investment at the border, meaning goods and people trying to come over the border often have to wait for hours at the most trafficked crossings, which costs money on both sides. Part of the problem was the reaction to 9/11, which led to a focus on security over access.

“Only in the last few years has the space opened up to where we can say, we’re not just in a post 9-11 world, we’re also in a post-recession world,” Christopher Wilson, a Mexico expert at the Wilson Center, says. “It’s clear now that economic security is part our national security.”

Long waits = less work, and more migrants

Economic performance is a key driver of illegal border crossings. When the US economy is stronger than Mexico’s, unauthorized immigration goes up as more immigrants seek work across the border. A logical way to keep Mexicans from illegally crossing the border for American jobs, then, would be to boost job creation in Mexico. And a good way to do that is to speed up cross-border trade between Mexico and the US. By contrast, deadlock at border crossings means fewer jobs in both Mexico and the US.

For example, a three hour wait is a drag on productivity for people crossing the border for business. That’s especially true for short-haul truckers who make multiple trips daily across the border, since US and Mexican truckers can’t operate legally in the opposite country. Delays mean the difference between three trips a day and four or five. The inefficiency adds up quickly, especially as more factories stock less inventory in favor of just-in-time deliveries.

Estimates of the cost of all that waiting (PDF, p. 76) vary, but it’s in the range of billions of dollars and thousands of jobs each year. (A modest estimate is $12 billion for both countries combined.)

What the bill does, and where it falls short

The current bill attempts to address the waiting issue, mostly by hiring 3,500 additional customs officers. But it doesn’t do enough to address much-needed infrastructure updates to add or extend additional lanes of road, gates and pedestrian walkways. In particular, San Ysidro—the crossing between San Diego, California and Tijuana, Mexico and the world’s busiest border crossing—could use that investment. 100,000 people switch sides at San Ysidro each day. The US and Mexico agreed to an expansion there, and while Mexico has added new infrastructure, it remains unused because the US lags behind, waiting for government funding.

“A $500 million investment is inhibiting a $6 billion gain in the region,” Mario Lopez, the City of San Diego’s director of binational affairs, says. There are similar cases in Texas and Arizona.

California senator Dianne Feinstein added an amendment to the immigration bill to update those ports, but advocates worry it isn’t specific enough to prompt real action. A cheaper way to improve border crossings, according to Lee, is upgrading and expanding the government’s “trusted traveller” programs, which allows individuals to pass background checks in advance for a quicker transfer.

Even then, the US would still need to upgrade infrastructure: In some cases, the special lane for expedited travelers begins only a hundred feet from the border. Meanwhile, the traffic jams extend for miles.