added pthread_join