The House has rejected a measure to impose stiff restrictions on how the FBI uses information on Americans’ communications inadvertently swept up in the collection of foreign intelligence.

The measure would have required the FBI to get probable cause warrants in most cases before querying Americans’ information in the database.

The bipartisan measure written by Reps. Justin Amash, R-Mich., and Zoe Lofgren, D-Calif, failed by a vote of 183-233.

Those opposed said it would prevent U.S. law enforcement and intelligence agencies from detecting potential threats to national security. Those who backed the measure argued that the FBI should not be able to query Americans’ information in the database without a warrant.

The House also voted Thursday to reauthorize the program, which was set to expire on Jan. 19, for six years.

The vote was 256-164 to extend the program, known as Section 702 of the Foreign Intelligence Surveillance Act.

The legislation still has to go through the Senate. But fewer lawmakers appear to favor changes to spying laws.

Congress did vote in 2015 to end and replace a program revealed by the leaks from former intelligence contractor Edward Snowden. However, lawmakers also favored extending that overhaul. The leaks disclosed that the NSA, under Section 215 of the Patriot Act, had been secretly collecting logs of Americans’ domestic phone calls.