fixes a bug on the form validation