fix for downloading file from stream