Fixed infinite loop of cache clearing.