not working
state machine is working