implementing correct use of the cache