Added Reachability.
added offline logic