more changes to state machine