change into multi-thread typeto support more than one client