if stream is specified, use it