The House on Monday passed a measure to overhaul a Homeland Security Department office meant to protect individuals’ civil rights amid a barrage of criticism that it has failed those seeking its assistance.

The Civil Rights and Civil Liberties Office was established with the department’s creation to ensure that the rights of individuals subject to its programs and activities are protected. The authorization legislation written by Rep. Al Green, D-Texas, and approved unanimously on Monday, would give the office more teeth to carry out its responsibilities. Each Homeland Security component would have its own civil rights and civil liberties (CRCL) officer and those employees would have new authority to access all relevant department records. With the secretary’s approval, they could also subpoena non-federal entities.

The bill comes after reports, which were later substantiated, about the office’s impotence and incompetence. Through the Government Accountability Project, several whistleblowers notified Congress and other overseers about CRCL failing to uphold standards at Immigration and Customs Enforcement detention facilities. The office “repeatedly chose not to investigate the individual cases” raised by Ellen Gallagher, then a policy advisor at CRCL, that “evidenced serious violations,” GAP said in its letter. The complaints were later verified by the DHS inspector general.

Gallagher on Monday praised the House legislation, saying it would ultimately help prevent “abuses of civil detainees.”

“By seeking to empower CRCL,” Gallagher said, Congress “expressly recognizes an existing gap in executive oversight which enables ICE to mistreat the estimated 52,000 migrants held daily in its custody. H.R. 4713 will help improve DHS oversight in a long-neglected area.”

Scott Allen and Pamela McPherson, two doctors who serve as medical and mental health subject matter experts for CRCL, blew the whistle on failures to uphold the rights of detainees while the Trump administration’s zero-tolerance policy was in effect. Their concerns also went ignored by CRCL leadership, GAP said.

Scott Shuchart was the senior adviser to the head of CRCL from 2010 to 2018, but resigned during zero tolerance and subsequent separation of migrant families. In a report for the progressive think tank Center for American Progress, where he is now a senior advisor, Shuchart said the Trump administration’s aggressive approach to curbing immigration has made “existing weaknesses in CRCL’s mandate and functioning clearer than ever.” He called for reforms to boost the office’s authority, independence and transparency, similar to the changes the House passed on Monday.

“Reforms will give the agency better tools to ensure more meaningful oversight and lay the groundwork for the DHS to be both more effective in its security objectives and more respectful of American constitutional values in the future,” Shuchart said.

Tom Jawetz, CAP’s vice president for immigration policy who also worked on the report, said on Monday that while CRCL’s deficiencies are “baked into the office itself,” both the George W. Bush and Obama administrations did a better job of bringing the office to the table.

“Those conversations have stopped” under Trump, Jawetz said. The bill, however, would “embed respect for civil rights and civil liberties into the culture of each of the components” at DHS.

He praised the House legislation in particular for both giving CRCL the tools it needs and for boosting transparency by enabling it to report to Congress annually without preapproval from the department.

The measure would improve communication with those who raise complaints to the office and require it to post summaries of its findings publicly. The bill would also require the office to issue civil rights and civil liberties impact assessments and review all policies and procedures to ensure no individual’s rights are being violated. Eventually, Jawetz said, he would like to see CRCL have its own, independent chief legal counsel rather than running those operations through the department’s general counsel. He praised the measure for creating a clear path for CRCL to take over investigating a complaint when the inspector general does not act and for establishing a model of collaboration between the two offices.

Dana Gold, GAP’s senior counsel, also applauded the bill for integrating DHS’ “primary oversight functions.”

“With the raft of serious complaints that whistleblowers and others have surfaced to these agencies—harms posed to migrant children in detention, the abusive use of solitary confinement on migrant detainees, and the dangerous and illegal effects of asylum policies under the Remain in Mexico program—legislation to strengthen DHS oversight is absolutely essential to prevent ongoing and foreseeable harm that continues unabated,” Gold said.