using state_machine now