Added pthread_join at the end of the main program