Only use the static IP if it is indeed a static IP. Otherwise assume it's DHCP and get the IP that way.