fix null value at end of stream