make window properly garbage collected