Fixed a bug concerning form validation