validates fields