Fixed attribute error when retrieving from cache