fixed double free and ipv6 bugs