fix bug of pipe read