Implement onClose callbacks