Added onClose callback