stream on_close buf fix