fixed a cts offset crash on the flush at the end of the stream