added checkPipe()