class validation