able to handle multi-pipe with bug
bug fix