Fix bug in caching strategy