change the state machine