Updated button event handling