fix in the pipe method, don't close the output stream