fixed a bug leading to potentially use the cache with a wrong operator