add onClose event handerl