close window when done viewing