fix some bugs in read standard output