make sure to write all data we have to the pipe