correctly check for class variable