validate mandatory fields