Fixed bug with cache retrieval