Aircraft maker Boeing reports adding 2,000 new jobs to its St. Louis plants and promises they are safe “for the long term.”

The new announcement is a reversal of the dismal future Boeing thought it saw for its Missouri plants after the company lost a series of military contracts. But the company retrenched and switched its facilities to making commercial jet parts, instead, turning a dark future into a solid, sustainable market, the St. Louis Dispatch reports.

The company also won two new military contracts to replace lost orders, the T-7 Air Force trainer jet and MQ-25 Navy refueling drone.

Consequently, over the last year and a half, Boeing’s St. Louis facilities have added 2,000 new workers, growing the workforce to 16,000 workers.

“If you think back to where we were in 2014 and looking forward you can imagine we had many different scenarios for how this might play out for the site,” said Boeing Senior Vice President Shelley Lavender. “I will tell you the one scenario we didn’t have is the one scenario that happened.”

The company’s change of focus to commercial plane manufacturing helped save the St. Louis plants and the addition of the two recent military contracts only added gravy to the plan, Boeing says.

The success of Boeing’s St. Louis operations is welcome news, indeed, with the company’s increasing troubles with its embattled 737 Max airliner. Just recently Canadian officials began calling for major changes in the 737’s software package. And the company quietly unveiled a new version of the Max to try and correct the issues that has kept entire fleets of the plane grounded all around the world.

Follow Warner Todd Huston on facebook.com/Warner.Todd.Huston.