added validation stuff to mandatory fields