The recent tragic crash of a second 737 MAX aircraft prompted airlines around the globe to halt any and all passenger flights using Boeing’s popular jet. Now, new details from a preliminary investigation reveal that software designed to keep the plane from crashing may have been to blame.

A software feature called the Maneuvering Characteristics Augmentation System (MCAS) appears to have been triggered shortly before the plane dove towards the Earth. The system is supposed to activate when sensors on the plane tell it that the aircraft is moving too slowly or climbing at too steep of an angle, preventing a stall that could result in a crash.

When a plane is at risk of stalling the easiest way to get more air flowing through the engines is to dip the nose down to gain speed. That’s what the system is supposed to do if the plane is at risk of a stall, but in this case it’s possible the system triggered erroneously, possibly causing the plane to dive downward even if everything was seemingly fine.

As Wall Street Journal reports, this malfunction is thought to be connected to a similar issue present in the previous 737 MAX crash, a Lion Air flight in 2018. Between the two accidents, nearly 350 people lost their lives. There were no survivors of either crash.

The MCAS system seems to have pulled both planes into dives, and the investigation has revealed that the pilot of the Lion Air jet was fighting against the aircraft to keep its nose pointed up. The plane, which the MCAS system falsely believed was at risk of stalling, pushed the aircraft down towards Earth, causing a loss of control and ultimately ending in a crash.

Earlier this week, Boeing reportedly began rolling out a software update to 737 MAX aircraft that may prevent the MCAS from being triggered erroneously. Simulations using the new software showed the updated system made it easier for pilots to control the aircraft without having to manually disable its software to prevent a crash.

Crash investigations typically take many months to complete, and it’s unlikely that Boeing’s 737 MAX planes will be allowed back in the skies before safety officials explore every possible reason why both planes came down. In the meantime, the planes will remain grounded.