@rkorytkowski , @dkayiwa ,This is a mistake :) . Creating the new cache should come before the for loop begins. I have copy and pasted it to the wrong place.