add some fclose(), close the pipe