Only about a quarter of U.S. railroad tracks that carry passenger trains have an anti-crash system that safety officials say could have prevented a fatal weekend crash, even though a year-end deadline to finish installing it is just months away.

The technology, known as positive train control, or PTC, is in operation on only 45 percent of tracks owned by freight railroads and 24 percent of tracks owned by passenger railways, according to the Federal Railroad Administration.

Congress has mandated full implementation by Dec. 31, 2018, after granting a three-year extension.

The project has lagged in part because of the $14 billion cost of installing it on 60,000 miles (96,000 km) of track and 18,500 locomotives, an industry group has said. Rail operators also had to develop and deploy a new radio system and back-office infrastructure, the Association of American Railroads said.

Allan Rutter, a railroad infrastructure specialist at Texas A&M University’s Transportation Institute, said the system has to be compatible across dozens of differentrailroads to be effective, another hurdle to be crossed.

“The simple answer is, it’s really, really hard,” Rutter said. “It’s not like you can go down to Best Buy and buy this stuff.”

PTC is designed to prevent derailments or crashes caused by excessive speed. The National Transportation Safety Board says at least 81 fatal accidents since 1969 could have been prevented with PTC.

The Association of American Railroads did not respond to a request for comment, but on its website it called PTC “an unprecedented technological challenge.” It said the biggest U.S. railroads “are on track to meet all statutory deadlines to install and implement PTC.”

Amtrak, the government-owned passenger rail carrier, has PTC on about two-thirds of its own tracks, but many of its trains travel on tracks owned by other operators, the Federal Railroad Administration says. By comparison, CSX Corp, the third largest U.S. railroad, has 45 percent of its 9,600 miles (15,400 km) of track under PTC operation.

The pace at which railroads have installed PTC has come under increasing scrutiny after a series of crashes involving U.S. passenger trains in recent years.

In the latest deadly accident, the fourth involving an Amtrak train since early December, the passenger train struck a parked CSX freight train on a siding in South Carolina, killing two people. Safety officials say a padlocked switch on the CSX-operated tracks sent the Amtrak train down the siding.

The three-year extension granted by Congress followed lobbying by major railroads. The Transportation Department can extend the deadline again to 2020.

Senator John Thune, a Republican who chairs the Commerce Committee, which oversees rail safety, told Reuters last month that railroads needed to meet the deadline.

“We pushed it now a couple different times and they need to get there,” Thune said.

Transportation Secretary Elaine Chao last month sent a letter to railroads and transit agencies urging them to meet the PTC deadline. ( Additional reporting by David Shepardson)