add thread and worker code.