updated state machine