added Stage.onClose to allow gentle network disconnect