made some changes for getting the network reachability