add sanity checking through pipes