New York’s most recent terror attack immediately drew political controversy when analysis revealed that the suspect, Green Card-holder Sayfullo Saipov, had gained permanent residency in the US in 2010 as a result of the 1990 Diversity Visa (Lottery) Program, a fact that was shared smugly by President Trump on Twitter shortly afterward. While Trump used the incident as an opportunity to attack Democrats, he actually found himself on the correct side of a policy issue; the diversity visa lottery is a foolish way to handle immigration policy, and merit-based programs and a pathway to citizenship should replace the program.

Saipov killed 8 people on Oct. 31 in a twisted act of terrorism in Lower Manhattan in New York City, driving a pickup truck through a crowded bike lane. He was one of 50,000 annual winners of the visa lottery. Given that Saipov was an Uzbek immigrant, he represented perfect fuel for Trump’s anti-immigration dogma on Twitter, in which he not only stressed stricter limits on immigration but also specifically ending the the Diversity Visa Lottery Program in favor of more merit-based immigration.

The most powerful man in the world’s under-140-character statement read, “The terrorist came into our country through what is called the ‘Diversity Visa Lottery Program,’ a Chuck Schumer beauty. I want merit based.”

The lottery program was created in 1990 by congressional Democrats, including Schumer, as an effort to increase immigration from countries which experienced very low rates of emigration to the United States, and has granted over 1 million green cards since. The program has accounted for approximately 5 percent of all legal immigration into the United States annually.

Since Trump failed to describe the nuance of the program’s most significant issues, here they are: Firstly, the few preconditions for the program include a review of the applicant’s police and military records from their home country, a high school education, basic employment experience and residency from a country that sends relatively few immigrants to the US annually.

Secondly, of all applicants that meet the loose criteria (roughly 15 million annually), they are all chosen randomly from a lottery, giving no weight to risk-assessment, validity of character, education, service, knowledge of the country, English proficiency or entrepreneurship to potential applicants beyond the most basic requirements. Here, in the land of “opportunity and merit,” some random person who went to high school, doesn’t have a police record from Mozambique and has some work experience, has an equal chance of admission into permanent residency through the diversity visa program as an international philanthropist.

So Trump played the blame game, and was he right? Not really. Although Schumer was a lead sponsor of the program in 1990, he has since led efforts to kill the program and emphasize more merit-based immigration policy.

Although it’s doubtful Trump actually intends to push for any more additional access for any non-European immigrants, his proposal in his 4 a.m. tweet is something that most Americans actually agree on and even has limited bipartisan support.

According to a 2013 Fox News poll, 78 percent of Americans favored “allowing illegal immigrants to remain in the country and eventually qualify for US citizenship, as long as they meet certain requirements like paying back taxes, learning English, and passing a background check.” The poll only referred to illegal immigrants already in the US, but nonetheless shows overwhelming public support for admitting immigrants on the basis of certain merits.

This polling was conducted in 2013 as a bipartisan congressional effort to pass comprehensive immigration reform, which would have eliminated the Visa program and focused on a pathway to citizenship. The Border Security, Economic Opportunity and Immigration Modernization Act of 2013 (colloquially called the “Gang of Eight” bill) ultimately failed due to majority congressional Republican refusal to grant undocumented immigrants a pathway to citizenship (and good old Obama-obstructionism). Trump and Republicans are right that a lottery-based immigration is bad policy. However, they’ve already shown they’re not open to dialogue about productive and realistic solutions.

The lottery program does pose a relatively small, but not negligible risk to our national security, as evidenced by Mr. Saipov as well as prior incidents, and is ideologically askew to our nation’s immigration principles of merit. It should be repealed and replaced as soon as possible with a program that rewards immigrants willing to work their hardest to become a part of this nation’s community.

In response to the president’s criticisms of the Diversity Visa Program, Americans must ask that instead of merely attacking political opponents and inciting racial animus, he propose a realistic, merit-driven policy that would operate under the guiding principles of the American Dream, as opposed to his tendency toward divisive nationalism.