Update to statemachine