moved duplicated IP sanity checks into get_geoip()