adding error handling for reachability