add statemachine factory