updated reachabilityChanged method