Fixed another state machine issue