Make sure we close the pipe always