fixed final problems with pipe merging