add thread and sleep