updated state_machine