Two Air India pilots have come under fire after they took a 40-minute break from the cockpit and asked flight attendants to sit in for them. Their stunt almost ended in disaster when one of the flight attendants accidentally turned off autopilot, endangering the lives of the 166 passengers on board, The Mumbai Mirror is reporting.

According to the news outlet, the plane was 30 minutes into a flight from Bangkok to Delhi when First Officer Ravindra Nath asked a flight attendant to occupy his seat while he excused himself for a bathroom break. A few minutes later, co-pilot Captain B K Soni also decided to leave the cockpit, and asked another flight attendant to keep an eye on things. According to reports, the co-pilot spent a few minutes teaching the two flight attendants how to operate the aircraft (phew!) before leaving to take a nap in a business class seat.

It seems First Officer Nath emerged from the bathroom and decided to join Captain Soni for a snooze – that is, until one of the flight attendants accidentally switched off autopilot. The two wingmen jumped up and ran back to the cockpit to regain control, but their devious antics didn’t go unnoticed. A senior cabin crewmember who witnessed the dramatic events brought the incident to the attention of the airline’s management, and all four parties involved were de-rostered and later suspended pending an investigation.