fix close crash