fix server loop connect-disconnect