fixing timing issue, can cause multiple restarts on startup