Implemented the initialization process of the thread