Fix bug preventing from clearing the cache properly