Cache implementation fix