fix some bug
improve performance of streaming