Modified using gai_strerror to get proper error message.