Updated the code to get the right host:port