add test for state_machine