added get_ip function