this is the server with multithreads