stream: fix end to ended