onCancel and onClose take an additional argument