fixed a redundant close window command