add state_machine
merged