Fixed bug with cache