Fix form submit and validation