fix the bugs for stream buffer