add usage of pthread_detach