init the thread