An American Airlines mechanic has been charged with sabotaging an airliner with 150 people aboard, causing it to abort a planned flight seconds before takeoff.

Abdul-Majeed Marouf Ahmed Alani was arrested Thursday and charged with “willfully damaging, destroying, disabling, or wrecking an aircraft … and attempting to do so,” after allegedly admitting to investigators on Thursday that he had tampered with a crucial part of American Airlines Flight 2834’s navigation system on July 17. The plane was taking off from Miami International Airport, bound for the Bahamas.

Alani, who investigators identified using surveillance footage, admitted he had glued a piece of foam into the flight’s navigation system, according to an affidavit submitted to a Florida district court Thursday.

He told investigators his “intention was not to cause harm to the aircraft or its passengers.” If the navigation system had been fully disabled, pilots would have had to operate the plane manually without data on speed and pitch.

He said he tampered with the plane in the hopes of being called on to fix it––securing more overtime, prosecutors alleged.

American Airlines and a 12,000-strong mechanics’ union are currently embroiled in a long-running dispute over pay. Alani told investigators that the dispute had affected him financially.

As the plane sped down the runway, pilots were alerted to an error and aborted takeoff seconds before the plane lifted off the ground.

“At the time of the incident, the aircraft was taken out of service, maintenance was performed and after an inspection to ensure it was safe the aircraft was returned to service,” American Airlines said in a statement provided to TIME.

“American immediately notified federal law enforcement who took over the investigation with our full cooperation.”

Alani is scheduled to appear in a Miami court at 1.30 p.m. on Friday.

Write to Billy Perrigo at billy.perrigo@time.com.