fixed server thread bug