added event handling for submit form