Fixed fatal dialog bug related to the active window status