fixed a critical FSM bug per issue #309