fix bug in streaming