fixes for state_machine