State_machine is run