Switching windows with current window closed