Fixed variable name and added caching for data