add thread and queue