SpaceX says it has figured out what caused one of its spacecraft to explode during a ground test in April. A valve accidentally leaked some of the vehicle’s propellant, starting a chain reaction that caused the spacecraft to burst apart. Now that the cause has been identified, SpaceX says it is replacing these parts in all future versions of the vehicle to make sure this explosive leak doesn’t happen again.

The spacecraft that SpaceX lost was a test version of the company’s Crew Dragon, a capsule that’s being built for NASA to take astronauts to and from the International Space Station. This particular capsule was the very first Crew Dragon that SpaceX had ever launched into space. In March, the vehicle — without a crew — successfully docked with the ISS and then returned back to Earth during a flawless test mission. But during routine tests on the vehicle on April 20th, the capsule violently broke apart and spewed orange gas into the sky.

SpaceX immediately formed an investigation team after the accident to figure out what caused the explosion, and the company has been working with NASA ever since. But up until six weeks ago, SpaceX still hadn’t narrowed down the exact cause. With the discovery of the leak, the company now says the investigation is about 80 percent complete. “It’s hard to tell... how much time we need to close this out,” Hans Koenigsman, vice president of build and flight reliability at SpaceX, said during a press conference. “But you want to make sure that the capsule — everything — you want to make sure that we find all the right corrective actions.”

“It’s something that the components should not have done.”

The company believes that the problem originated with the Crew Dragon’s emergency abort system, which consists of a series of small thrusters embedded within the capsule. If all goes well during a mission, these tiny thrusters are never really meant to be used. But if there is some kind of failure during a future launch, the thrusters can ignite and carry the Crew Dragon safely away from a disintegrating rocket.

SpaceX says that a leaky valve caused the propellant needed for these thrusters to cross into another system — one of really high pressure. When this contamination occurred, the high forces slammed the liquid around, causing valuable components to fail and leading to the ultimate loss of the capsule.

Koenigsman said that this contamination definitely was not anticipated, though the kind of valve that leaked has been known to have some internal leakage problem. Ultimately, he acknowledged that, to some extent, this was a design issue. “It’s something that the components should not have done,” Koenigsman said. “But at the same time, we learned a very valuable lesson on something going forward, one that makes the Crew Dragon a safer vehicle.”

“it was a huge gift for us.”

SpaceX will replace all of these types of valves with another component known as a burst disk, which is supposed to be much more reliable, according to Koenigsman. SpaceX claims it has many Crew Dragons in various stages of production at the company’s headquarters in California. However, it’s unclear when the Crew Dragon will fly again. Before the explosion, SpaceX had been planning to fly its first astronauts on the vehicle by the end of the summer. Now it’s looking increasingly likely that SpaceX won’t fly people until the beginning of next year — though Koenigsman isn’t ruling out a 2019 flight. “My emphasis is really on making sure this is safe,” he said. “So end of the year, I don’t think it’s impossible, but it’s getting increasingly difficult.”

However, a NASA representative said she is appreciative for the failure, especially since it occurred on the ground instead of during a flight. “We had the ability to find an issue with the hardware and be able to find the hardware and be able to assess the hardware,” Kathy Lueders, the program manager for NASA’s Commercial Crew Program, said during the press conference. “So it was a huge gift for us.”