added sigpipe handler