connects to server