Add reachability check to prevent crash out of network