Fixed cache in anonymous function