statemachine fixed