fixed the double windows open after modal dialog bug