Use with statement in get_ip_address()