added thread_num param