some changes for state_machine