fix bug when add task in new thread which is occupied