Boeing is replacing the head of its commercial-airplanes division as it struggles with a crisis created by two deadly crashes of its newest airliner.

Boeing said Tuesday that Kevin McAllister is out as chief executive of Boeing Commercial Airplanes. He’s being replaced Stanley Deal, who has been leading the company’s services division.

The shake-up in Boeing’s top ranks comes just days after the release of internal communications that showed a senior test pilot experienced serious problems while testing flight-control software for the 737 Max on a simulator.

That software, called MCAS, is at the center of investigations into two crashes that killed 346 people and led to grounding of the Max. Boeing is taking much longer than executives expected to change the software and get the plane flying again.