fixed stream reading to avoid caching