Adding waiting for windows (for save-as pop-up)