fix infinite loop at pipestream handler