fixed: stateMachine didn't emit events, didn't use values