updating to catch socket/dns errors