Hong Kong CNN Business  — 

Tesla is upgrading the battery systems on some of its cars after two recent unexplained fires.

The software update, which will be dispatched wirelessly to all Model S and Model X cars around the world, aims to better protect the batteries and improve their overall longevity.

The change comes after a Tesla (TSLA) vehicle caught fire in Hong Kong on Sunday. That was the second time a Tesla (TSLA) was found burning in recent weeks.

Last month, footage circulated of a Model S appearing to explode at a car park in Shanghai, prompting the company to investigate along with Chinese authorities.

Tesla said it sent a team to the site of the Hong Kong fire to investigate the incident.

Hong Kong’s fire department confirmed that a vehicle caught fire at a parking lot in a shopping mall. An official declined to share details on the make of the car.

Tesla added that while it was still working to determine the cause of the fire, it had found that “a few battery modules were affected.”

“Out of an abundance of caution, we are revising charge and thermal management settings on Model S and Model X vehicles,” said the company spokesperson.

A Tesla Model S electric car charging in Berlin, Germany.

Electric vehicles are generally far less likely to catch fire than gasoline vehicles, and previous incidents involving Teslas largely featured moving vehicles or vehicles that crashed.

Tesla, which currently has over half a million vehicles on the road, defended its technology on Thursday, saying its vehicles “are 10 times less likely to experience a fire than a gas car.”

The company added that its battery packs are designed “so that in the very rare instance a fire does occur, it spreads very slowly and vents heat away from the cabin, alerting occupants that there is an issue and giving them enough time to exit the vehicle.”

Nevertheless, the Tesla spokesperson said, “we believe the right number of incidents to aspire to is zero.”

Stella Ko contributed to this report.