Fixed cache function.