Members of Congress said Wednesday that more careful vetting of visa applicants may be needed in the wake of a terrorist attack in New York by Uzbek national, but they did not quite embrace President Donald Trump’s demand for the diversity visa lottery program to be abolished.

Less than 24 hours after the attack, Trump blamed the “Democrat Lottery System” in a series of tweets on Wednesday morning, referring to the diversity lottery as “a Chuck Schumer beauty.”

As the president suggested, Senate Minority Leader Chuck Schumer, D-N.Y., did introduce the original bill that created the program in 1990, but Democrats and some Republicans have come to his defense and said he has tried to end it in recent years.

Schumer responded to Trump’s suggestion that he bears responsibility for a terrorist attack that occurred in his hometown by questioning the president’s proposal to reduce spending on certain anti-terrorism programs.

“President Trump, instead of politicizing and dividing America, which he always seems to do at times of national tragedy, should be focusing on the real solution — anti-terrorism funding — which he proposed cutting in his most recent budget,” Schumer said in a statement.

The diversity lottery provides up to 50,000 visas per year to random applicants from countries with historically low immigration rates to the U.S. According to CNN, in 2016, diversity visas accounted for 45,664 of the approximately 1 million green cards issued.

Applicants under the program, which was created by the bipartisan Immigration Act of 1990, must have at least a high school education or equivalent and two years of job experience. People with known criminal records and connections to terrorism are already barred from admission, as are applicants from countries identified as state sponsors of terrorism.

Concerns have been raised about the security of the program in the past, though. President Trump has backed a Republican proposal that would replace the diversity program with a more merit-based immigration system.

Republican lawmakers interviewed Wednesday agreed with the president that an overhaul of the vetting involved in the visa system is necessary.

“We’ve got to have a much better vetting process in the United States,” said Rep. Chuck Fleischmann, R-Tenn. “I think President Trump is exactly correct in saying we have got to solve the problem.”

Rep. Steve Pearce, R-N.M., said the diversity lottery has some benefits, and he sees increased vetting as a higher priority than scrapping the program.

“Some people would like to just stop the whole lottery program, but I’ve seen some good come from that,” he said. “We’ve now seen bad come from it. It’s not the program, it’s the way its carried out.”

The Senate already agreed to ditch the lottery program as part of the broader “gang of eight” immigration reform compromise in 2013, according to Sen. Jeff Merkley, D-Ore. That legislation died in the House.

“Certainly we in the Senate weighed in, myself included, on a bill that did eliminate that program,” he said.

Merkley suggested that legislation, which was adamantly opposed by many conservatives and which Trump has dismissed as “amnesty” in the past, could serve as a good foundation for accomplishing some of the president’s goals.

“We’re going to need a lot more details from the president,” he added.

Sen. Chris Van Hollen, D-Md., observed that Schumer supported the 2013 compromise. He also disputed whether “five hours and an early morning tweet” is enough time to figure out the lessons to be learned from the attack.

“It’s wrong to jump to the conclusion that something in place since 1990 is the cause of something that happened in New York City,” he said.

Van Hollen also criticized the president for resorting to politically divisive rhetoric in the immediate aftermath of a tragedy.

“All presidents, Republicans and Democrats alike, have always worked to unify the country and learn the lessons and act,” he said. “Don’t just tweet from the hip.”