fix thread and protocbuf parse bugs