src: fixed illegal state exception