Make server connection more flexible