Adding onConfirm handling