moved the cache update logic for stream to listener logic