implements closeWindow()