Federal regulators will order operators of Boeing 787 Dreamliners to shut down the plane’s electrical power periodically after Boeing discovered a software error that could result in a total loss of power.

The Federal Aviation Administration said on Thursday that Boeing found during laboratory testing that the plane’s power control units could shut down power generators if they were powered without interruption for 248 days, or about eight months. The findings were published in an airworthiness directive.

Boeing said the problem had occurred only in lab simulation and no airplane had experienced it. Boeing said that powering the airplane down would eliminate the risk that all power generators would shut down at the same time.

The company said it was working on a software update that should be ready by the fourth quarter this year.