Updates the function get_ip so it works for <1.8.2