Fixed the form validation bug