added validation for the form field