Added network reachability check before trying to hit the web server.