changed type handling
added ipv6 support