adding more thread code