trying to fix function onConfirm(button)