(Detroit) US automaker Tesla is recalling more than two million vehicles to repair a system supposed to ensure drivers pay attention when using Autopilot.

Documents released Wednesday by U.S. security regulators indicate the company will send out a software update to address the issues.

The recall comes after a two-year investigation by the National Highway Traffic Safety Administration into a series of crashes that occurred while the Autopilot partially automated driving system was in use. Some have been fatal.

The agency says its investigation found that Autopilot’s method of ensuring drivers are paying attention may be inadequate and lead to predictable misuse of the system.

The recall covers models Y, S, 3 and X produced between October 5, 2012 and December 7.

The software update was expected to be sent out for some affected vehicles on Tuesday; the others should be shipped at a later date.

Autopilot includes features called Autosteer and Traffic Aware Cruise Control, with Autosteer intended for use on limited-access highways when not working with a more sophisticated feature called Autosteer on City Streets.

The software update will apparently limit where Autosteer can be used.

Auto safety advocates in the United States have for years called for stricter regulation of the driver monitoring system, which primarily detects whether the driver’s hands are on the steering wheel. They want cameras to ensure a driver is paying attention, which is used by many other automakers with similar systems.