add middle to connect server