An off-duty pilot riding in the cockpit of a Boeing 737 Max 8 fixed a malfunction on the second-to-the-last flight for the aircraft before same plane crashed during a different flight in the Java Sea the next day, Bloomberg reported on Tuesday evening.

The pilot reportedly advised the crew to kill the power to a motor that was pointing the aircraft's nose downward. That move helped prevent a catastrophe, according to Bloomberg.

The aircraft was being operated by a different crew the next day, on October 29, 2018, and crashed fewer than 15 minutes after takeoff, killing all 189 passengers and crew on board.

That same system is under intense scrutiny as authorities continue to investigate another crash involving the 737 Max.

An off-duty pilot riding in the cockpit of a Boeing 737 Max 8 fixed a malfunction during the second-to-the-last flight for the aircraft before it crashed into the Java Sea the next day, according to a Bloomberg report published on Tuesday that cited two people with knowledge of the investigation in Indonesia.

The Lion Air crew members reportedly received the help from the off-duty pilot, who fixed a malfunctioning sensor from an automated system designed to prevent the plane from stalling. The pilot advised the crew to kill the power to a motor that was pointing the aircraft's nose downward, Bloomberg reported, citing the people with knowledge of the investigation.

The same plane, which was being operated by a separate crew, crashed into the Java Sea near Indonesia the next day, on October 29, 2018. All 189 passengers and crew on board were killed.

A Lion Air spokesman did not provide additional comment on Bloomberg's findings.

Read more: The US government wants to audit how the Boeing 737 Max got approved to fly by the FAA

"All the data and information that we have on the flight and the aircraft have been submitted to the Indonesian National Transportation Safety Committee," a spokesperson told Bloomberg. "We can't provide additional comment at this stage due the ongoing investigation on the accident."

The 737 Max's automated safety feature has been under intense scrutiny after the Ethiopian Airlines Flight ET302 crash that killed all 157 passengers on March 10, five months after the Lion Air crash.

As Boeing and aviation authorities investigate the incidents, initial reports suggest that a faulty reading from a sensor could have played a role in both crashes. The reports indicated that the faulty sensor may have triggered the plane's automated system and pointed the nose downward after takeoff.

After the crash, other countries grounded the 737 Max aircraft, including China, which has the most number of 737s. The US was the last country to ground the plane.