Fixed caching count issue