WASHINGTON (NEXSTAR) — A potentially devastating economic shutdown was narrowly averted on Thursday. Congress voted to force rail companies and unions to agree to a new labor contract, ending the threat of a rail worker strike

After it pushed through the House on Wednesday, the Senate passed the bill Thursday to make rail companies and unions sign a new labor contract. That comes after several months of negotiations between the unions and companies failed.

“Nobody got everything they wanted in this negotiation. The companies moved. The unions moved,” Transportation Secretary Pete Buttigieg said. 

Senator Chuck Schumer said the bill requiring them to sign a new contract keeps the economy on track.

“The two sides have come together so we can avoid the shutdown, which would be extremely damaging to the country,” Schumer said. 

Without a deal the rail workers could’ve gone on strike, costing the economy billions of dollars per day as shipments of food, oil, and other goods ground to a halt. 

“The special importance for economic security and even national security of a functioning rail system. There is simply no substitute for it,” Buttigieg said. 

The sticking point in negotiations was paid sick leave for workers, which some unions wanted and the companies didn’t.

“People who are working at dangerous jobs in inclement weather have zero paid sick leave. That is outrageous,” Senator Bernie Sanders said. 

The House did pass a bill to add paid sick leave to the new contract, but it didn’t get enough votes in the Senate. President Biden says that doesn’t mean that fight is over. 

“Avoid the rail strike, keep the rails running, keep things moving and we’re going to go back and we’re going to get paid leave. Not just for rail workers, but for all workers,” Biden said

For now though, Congress says the immediate danger is over. 

“That was urgent and necessary to avert a catastrophic National Rail shut down,” Speaker Nancy Pelosi said.