updated state machine to better handle start/stop/reload events