created a class for validation