implemented server connection