Make closing window end call