corrected class level validation logic