change to multithread client