added option 'stream' to download streamed data