Update state-machine.js

fix