U.S. President Donald Trump signed an executive order this week that bars hundreds of thousands of foreigners from seeking employment in the United States by suspending new work visas.

The argument against the most significant of these visas, the H-1B, has always been that that they harm employment prospects for Americans and depress wages. Some of the criticism is justified: The H-1B visa, which U.S. technology companies and outsourcing firms use to hire 85,000 new foreign specialists each year, is indeed problematic, because it puts both American and foreign workers at a disadvantage. These visas are the U.S. tech industry’s dirty secret. They tie the foreign workers to their jobs and allow the employer to pay them less than they could be earning—which drives down pay for American workers as well.

But the solution isn’t for government to lock the doors or try to control wages; it is to let competition on the labor market do its magic. The simple fix is to allow H-1B visa holders to work for any employer that pays them the highest wage or for the start-up that offers the most rewarding work.The visas tie the foreign workers to their jobs and allow the employer to pay them less than they could be earning—which drives down pay for American workers as well.

This is something I have written about a lot, including in a 2012 book titled The Immigrant Exodus: Why America Is Losing the Global Race to Capture Entrepreneurial Talent. I warned then about the deep flaws in U.S. immigration policies and predicted that China and India would greatly benefit from these flaws—and, unfortunately, that prediction was correct. With help from workers who honed their skills in the United States but couldn’t stay, both of those countries have built innovation capabilities that rival the United States’, and both now have many technology start-ups valued in the billions of dollars.

Here is the problem: For decades, the United States has been bringing in large numbers of workers on temporary visas such as the H-1B, but it never increased the numbers of permanent-resident visas (“green cards”) available for those who want to stay. There are 140,000 green cards issued per year to employment-based visa holders, and the law stipulates that each nationality may receive no more than 7 percent of the total number of employment-based green cards. My research team  documented in 2007 that this limitation had trapped more than 1 million skilled immigrants and their families in immigration limbo. The Cato Institute found that number to be unchanged in 2020 and forecast that the backlog would increase to 2.4 million by 2030. Today, skilled Indian workers make up 75 percent of the employment-based backlog, and those who recently arrived face a wait of 90 years.

Technically, any H-1B worker can change jobs by filing a petition with the government, and some do take advantage of this rule. But there is a catch: The H-1B visa allows a path to permanent residency only when an employer sponsors a worker. And this is the carrot employers offer, one that most people coming to the United States want. Once they accept this carrot, they are trapped in immigration limbo because they can only change sponsoring employers or take new jobs at their current companies if the new job is in the same category and at the same level as the old one—otherwise they risk losing their status or having to reapply. Most don’t take the risk. Therefore, visa holders shun promotions and changes in their job description, leading to stagnating careers and lower salaries than they could otherwise make.Opponents of the H-1B visa are correct in claiming that the visa disadvantages American workers, who are effectively competing with bonded labor.

Opponents of the H-1B visa are correct in claiming that the visa disadvantages American workers, who are effectively competing with bonded labor. To the would-be immigrants, this indentured servitude is compounded by the employment restrictions that their spouses now face once again: The H-4 visas that permit them employment have also been suspended by Trump.

The overall problem could be fixed if the number of permanent-resident visas available for skilled workers was increased and the wait times decreased dramatically. But that is not going to happen in this era of pandemics and xenophobia. The most realistic solution is to untether the visa holder from the hiring company. In other words, allow an employee who enters the country on an H-1B visa and gets an offer of a higher salary to change jobs regardless of the status of his or her green-card application—without cumbersome additional paperwork. This way there’s no cheap labor anymore, and market forces take over. And, of course, the spouses of H-1B workers must not be prevented from working; no civilized society can place such restrictions on a group that is mostly women.

Technology companies don’t propose such a fix because it would cause them to lose power over the employee. Politicians won’t propose such legislation because it is not what tech-industry lobbyists want. Instead, we get a series of convoluted proposals that increase the role of government and disadvantage all workers, both American and foreign—and create the immigrant exodus.Attacking immigrants is the fastest way to destroy the United States’ remaining competitive advantages—and prolong the recession.

Sadly, there is unemployment in the tech industry, and there are many heart-breaking cases of Americans being displaced by cheap foreign labor. This is not an acceptable situation, and it is why smart immigration reform would fix the salary disadvantage. Having more highly skilled, job-creating immigrants will lead to more innovation and more jobs. It will make the economic pie bigger for everyone.

The key to competitiveness is to allow the tech industry to hire the best talent, no matter where it comes from. The economy thrives on competition of every form, including technology and skill. Attacking immigrants and demanding that companies hire Americans over people who are more skilled, as Trump is doing, is the fastest way to destroy the United States’ remaining competitive advantages—and prolong the recession.