Switch to state machine implementation
Handle stopped case