fix server connect method