dropped the object vars and fixed a foreach bug

The code was copying a new, unaltered data object into the cache every
time a loop happened. Not good for fetching the current (and altered on
purpose) data later after the loop ended.