Fixed the issue of passing incorrect pointer to pthread_create()