American Airlines claims it has restored most affected flights following a scheduling glitch that reportedly caused the airline to cancel thousands of trips.

CNBC reported that more than 12,000 flights were canceled between Sunday and Friday. They didn’t have a captain, first officers, or both. Pilots had also changed their assigned trips. The Allied Pilots Association represents American Airlines pilots.

American Airlines stated in an email that it had “restored most of the affected flights and don’t anticipate any operational impacts due to this issue,” which included the July 4 holiday weekend. American Airlines spokeswoman could not provide any details on how many flights were restored or dropped.

American Airlines confirmed that the pilot trip trading system was experiencing technical issues. Matt Miller, spokesperson for American Airlines, stated in an email that the platform allows pilots request to swap, add or drop certain trips.

The airline stated that “as a result, certain trip trading transactions could be processed when it shouldn’t have been allowed”. A follow-up question asking the airline if the technical problem had been resolved was not answered by them.

Similar scheduling problems in 2017 could have led to the cancellation of 15,000 flights in December 2017.

This glitch added to holiday travel chaos. As they have been experiencing in recent weeks, travelers were already dealing with hundreds of cancelled flights and a few hundred delays on Friday. Experts blame the flight disruptions on a shortage of pilots and air traffic controllers.

American pilots are pushing their employer to improve the schedules of aviators during contract negotiations. Pilots at Southwest Airlines and Delta Airlines have been protesting in recent weeks for better pay and schedules.

Dennis Tajer, a pilot for American Airlines, and the chairman of the communications committee for the Allied Pilots Association, attributed the recent rise in cancellations to poor scheduling practices by airlines. In an interview with CNBC, Tajer suggested that certain pilots are being underworked while others are overselling tickets for certain trips.