add class validation