fix some stream buf bug