Added state machine behavior back