Fix the resetting of in memory cache