fixing cache management