Adds the check for network connections and proper callbacks