join threads to main thread