Fix ip detection