add pipe-flushing segment to try to fix juegen's bug