remove thread code