fix bug with out window