Fixed LRU caching problem