bug fix in validateForm