Fixed caching counter bug