create abstact validator class to check for errors