Fixed restartonauto bug