Fix bug with exception during the cache update