Added onClose callback option