President Trump once used the murder of Kathryn Steinle, who, according to authorities, was killed by an illegal immigrant with a criminal past, to argue for a ban on Muslims entering the country.

Now, after an attack that killed eight in lower Manhattan on Halloween day, the president is arguing that the US immigration policy, specifically the diversity lottery visa program under which the Uzbek immigrant suspected in the attack entered the country, is to blame. Since taking office, Trump repeatedly has voiced concern over the diversity lottery program, and with this most recent attack, many in Congress likely will band together to ensure the program is eliminated.

It is understandable that politicians would rally in support of the program’s removal in the wake of a terrorist attack. Scrapping a system because a single beneficiary committed an act of terrorism, however, will not stop attacks. Rather than scapegoating in the aftermath of tragedy, we instead must focus on the root causes to prevent future attacks and to protect all Americans, both native born and immigrants, from those who seek to do harm.

The diversity immigrant visa program awards a visa for a green card, which grants permanent residency in the United States and is a path to citizenship, to up to 50,000 people per year. The lottery was created in 1990 as a way to increase diversity by allowing more immigration from countries that send relatively few people to the United States. According to the formula set out by law, countries that have had more than 50,000 natives immigrate to the United States in the previous five years are ineligible to apply to the lottery program. The visas are distributed among six geographic regions, and no single country may receive more than seven percent of the available visas in any one year. Most of the lottery recipients live outside the United States, but a few are in the country legally on other visas.

While applicants are selected for visas randomly, they still must meet strict security and eligibility requirements that all immigrants must clear to get those visas. Security screening involves many procedures, including biometrics to confirm the person’s identity using facial recognition and other technologies; name checks and fingerprint checks against multiple interagency government databases to identify potential criminal or national security issues; and checks against terrorist, organized crime, gang, and other watch lists.

Diversity recipients also must have a high school education or its equivalent, or two years of qualifying work experience as defined under provisions of US law. All recipients must go through an in-person interview and again are screened for eligibility through careful questioning. If any “inadmissibility ground” arises, which includes prior convictions for most crimes, security concerns, health-related issues, and prior US immigration violations, the visa can be denied.

Despite these lengthy procedures, lawmakers long have criticized the program as a threat to our country’s national security. While we acknowledge that the program has deficiencies, the diversity visa program has been an important component of the US immigration system. America was founded by immigrants and has flourished due to attracting people from all over the world. In fact, Trump’s top economic adviser, Kevin Hassett, long has maintained that the US should embrace more immigrant workers, not fewer. As a scholar at the American Enterprise Institute in 2013, Hassett wrote, “Perhaps surprisingly for a country that has long thought of itself as a nation of immigrants, the U.S. falls far behind almost all the other countries in the number of immigrants it admitted in 2010 relative to its population size.”

There is little evidence to suggest that this program has created a national security threat. All evidence so far indicates that Sayfullo Saipov, the suspected terrorist in the Manhattan attack, was radicalized years after entering the United States. In an extensive analytical report written by Alex Nowrasteh, an immigration expert at the Cato Institute, it was discovered that of the roughly 768,000 murders committed in the United States between 1975 and 2015, 0.39 percent were committed in an attack by foreign-born terrorists. To eliminate the program because of the acts of a few would be shameful to the thousands of innocent immigrants who rely on the program for a chance at the American dream.

It is true that this program, along with the rest of the US immigration system, needs reform. But efforts to reform must be balanced with our national enforcement interests, taking into account that immigrants have and will continue to make an enormous impact on our country’s prosperity.

As Thanksgiving approaches I am sure our founding fathers would want us to dash a bit of spice to our melting pot.

Michael J. Wildes of Englewood is the managing partner of Wildes and Weinberg, a former mayor of Englewood, and an adjunct professor at the Benjamin N. Cardozo School of Law in Manhattan. Write to him at michael@wildeslaw.com.