changes to state machine