Fixing cache bug