Boeing chief executive Dennis Muilenburg apologized Thursday for the 346 lives lost in crashes of Boeing 737 Max 8 aircraft in Indonesia and Ethiopia, according to a letter made public on the company’s website.

Muilenburg recognized the role in both crashes of a Boeing-approved flight system, called Maneuvering Characteristics Augmentation System. In certain dangerous situations, MCAS can cause pilots to lose control of an aircraft in response to erroneous data from the plane’s external sensors.

His comments followed the release of the preliminary report about the March 10 Ethiopian Airlines crash that killed everyone on the flight. Ethiopia’s transport minister said the crew had “performed all the procedures, repeatedly, provided by the manufacturer but was not able to control the aircraft.”

As Muilenburg had in the past, he expressed condolences to the family members of those killed.

“We at Boeing are sorry for the lives lost in the recent 737 MAX accidents,” Muilenburg wrote.

He later wrote: “I cannot remember a more heart-wrenching time in my career with this great company.”

Preliminary reports from investigators in Indonesia and Ethiopia indicated that the MCAS had activated in the two flights’ final minutes, with pilots struggling to keep the plane level as it pitched inexorably downward.

“The history of our industry shows most accidents are caused by a chain of events. This again is the case here, and we know we can break one of those chain links in these two accidents,” Muilenburg wrote, also noting that pilots have raised concerns over the potential for the flight system to create new risks in “what is already a high workload environment.”

“It’s our responsibility to eliminate this risk,” Muilenburg said, adding “we own it and we know how to do it.”

He also drew attention to the company’s efforts to improve the flight control system, an effort that began after Indonesian investigators issued their preliminary report in late November. The company is required to submit its final version of the software fix no later than April to the Federal Aviation Administration. The 737 Max 8 and 9 planes have been grounded for weeks.

“We’re taking a comprehensive, disciplined approach, and taking the time to get the software update right,” Muilenburg said. “We’re nearing completion and anticipate its certification and implementation on the 737 MAX fleet worldwide in the weeks ahead.”

And he once again applauded the safety record of the Boeing 737 even as he apologized for lives lost in the two crashes.

“This update, along with the associated training and additional educational materials that pilots want in the wake of these accidents, will eliminate the possibility of unintended MCAS activation and prevent an MCAS-related accident from ever happening again,” he added. “When the MAX returns to the skies with the software changes to the MCAS function, it will be among the safest airplanes ever to fly.”

And he promised the company would work to regain the confidence of the flying public, which has been rattled in recent months.

“We know every person who steps aboard one of our airplanes places their trust in us,” Muilenburg said. “Together, we’ll do everything possible to earn and re-earn that trust and confidence from our customers and the flying public in the weeks and months ahead.”