Fixed broken cache code