Fixed a bug in the state machine that didn't check validity of state transitions
Fixed a bug in the state machine that didn't check validity of state transitions

sbsdev/daisyproducer,sbsdev/daisyproducer,sbsdev/daisyproducer,sbsdev/daisyproducer