tweaking function onConfirm(button)