Mexico’s Senate approved an overhaul to the country’s labor code, a move that U.S. House Democrats made a pre-condition for debating a successor to the Nafta trade deal.

The Senate on Monday voted in favor of the bill in general terms 120 to 0, with two abstentions. It was passed by Mexico’s lower house earlier this month and supported by President Andres Manuel Lopez Obrador. The changes give workers the right to vote on unions and their labor contracts through secret ballots, both of which rarely occur in Mexico. The changes now go to the president for ratification.

Mexican lawmakers raced to pass the bill before the end of their session Tuesday to allow their counterparts in the U.S. to take up discussion of the trade deal, known as the U.S.-Mexico-Canada agreement, before their August recess. Democrats say that while approval of the changes is necessary for a debate on the deal negotiated last year by the Trump administration, they also want to see implementation and enforcement of the legislation.

The labor reform has ample safeguards in place to ensure that workers will finally be represented by their unions, Mario Delgado, the lower house majority leader, said in an interview this month. A labor annex to the USMCA explicitly requires that workers vote to decide on unions and labor contracts in Mexico, where employees often lack basic representation.

Delgado said that an independent agency and independent courts will replace the current labor board to resolve disputes and register contracts. Currently the labor board, where government officials, companies and unions hold representation, makes it difficult for workers to organize freely.