add more thread code