added close_pipe()