Fixes #8

Fixed the form validation code