class that validate data