Fix bug in stream end status