A bill designed to add transparency and oversight mechanisms to the National Security Agency’s warrantless foreign-surveillance programs fails to address major privacy concerns, civil-liberties advocates say.

The new USA Liberty Act might add several steps of congressional oversight to NSA spy programs like Prism and Upstream, critics say, but it doesn’t close a controversial loophole that allows law enforcement agencies such as the FBI to search the NSA database for U.S. residents’ communications during investigations unrelated to terrorism, nor does it adequately address European Union objections.

With Section 702 of the Foreign Intelligence Surveillance Act sunsetting on December 31, a bipartisan group of lawmakers introduced the bill—a work in progress, they say—on October 6 essentially to revamp and reauthorize it for six years.

Federal investigators rely on Section 702 surveillance programs to “detect and prevent horrific terrorist plots” against the United States, says Rep. Bob Goodlatte, chairman of the House of Representatives Judiciary Committee and primary sponsor of the USA Liberty Act.

“The program must be reauthorized, with reforms, to better safeguard civil liberties and strengthen national security,” says Goodlatte, a Virginia Republican.

But the bill, in its current form, doesn’t address the so-called backdoor search loophole that allows the FBI and other agencies to search U.S. residents’ communications when they are swept up in NSA foreign surveillance. The NSA programs are supposed to target only people outside the United States for terrorist activity and other issues related to U.S. national security, but U.S. residents’ communications are collected when they communicate with overseas targets.

It’s unclear how many U.S. communications are picked up by the NSA in so-called “incidental” collections. The agency has for years declined lawmaker requests to release the number of U.S. communications collected.

The bill would require the FBI and other agencies to get a court-ordered warrant to search the NSA database for U.S. communications when looking for evidence of a crime, but it wouldn’t require a warrant to search it for a wide variety of other reasons related to U.S. national defense and foreign-affairs interests.

Searches related to U.S. foreign affairs could cover a lot of legal activities by U.S. residents, including climate change activism, says Michelle Richardson, deputy director of the Center for Democracy and Technology’s Freedom, Security, and Technology Project.

“We’d rather see a warrant for all searches,” she says.

The bill takes some steps to better protect civil liberties, but continuing to allow backdoor searches is a “glaring deficiency,” says Neema Singh Guliani, a legislative counsel with the American Civil Liberties Union. “The bill would still allow the CIA, NSA, FBI, and other agencies to search through emails, text messages, and phone calls for information about people in the U.S. without a probable-cause warrant from a judge.”

The current wording of the USA Liberty Act leaves the NSA surveillance programs open to abuse, Guliani adds.

“Those worried that current or future presidents will use Section 702 to spy on political opponents, surveil individuals based on false claims that their religion makes them a national security threat, or chill freedom of speech should be concerned that these reforms do not go far enough,” she says.

It’s also unclear if the bill would satisfy calls by privacy groups in and outside of the European Union to better protect the privacy of European residents. Several privacy advocates are pushing the EU to back out of Privacy Shield, the recent agreement that allows U.S. companies to handle the personal data of people living in the European Union, unless Congress makes major changes to Section 702 of the FISA law.

The European Commission in April adopted a nonbinding resolution questioning NSA surveillance. Europeans object to the “lack of concrete assurances of not conducting mass and indiscriminate collection of personal data,” the resolution says.

The USA Liberty Act strengthens the U.S. Privacy and Civil Liberties Oversight Board, a surveillance watchdog that’s been inactive during President Donald Trump’s administration, in ways that could satisfy some European privacy advocates. It also borrows language from an Obama administration policy directive stipulating that bulk collection of foreign communications should be limited to national-security issues.

But the bill would not end mass surveillance of foreigners, Richardson of the CDT says.

“When you talk about pure spying authority,” she says, “there is nothing that would [rein in] the collection or use of information, when it comes to foreigners.”