properly handle IPv6