wait a while to close window