fix close crash bug