new method to init a thread