Better ip detection