Close/hide window after refresh