dialog crash bugs fixed (window token invalid).