Bug fix for onConfirm and onCancel callback function