caching logic fix