change server to multithread