do not use safebuf in thread