validation for returned data