more graceful ip detection