modify some new bugs improve output thread