getaddrinfo uncaught exception fix