Added UnknownHostException handling.