fixed server loop; now pthread_create() sends the correct parameter to threads