Update state-machine.js

fix
Merge pull request #1 from Okotetto/patch-1

Update state-machine.js