Fix bug with cache