fix segfault when disconnected
fix segfault when name resolution fails, but error out with explanation instead