Simple improvement on confirm button handler