auto close preview window