caching needs to happen after the function returns and not before