Added better form validation