adding code to parse ip address and ports when available.