added validation to forms