add signal handler to ignore sigpipe