add thread util
fix bugs of operator<< overwrite