add ipv6 and bugfix escaping