fixed event handling for form buttons