fixes in event handling for button