statemachine is working