Connects to server