fix bugs in connection class, continue to work for add support to multiple server connections