Added race conditions and made parents share pipe