Added class validation