Fix class variable caching issue