moved form submit logic to click handler