Update statemachine.js