             showMessage "Rules refreshed: #{url}."
             initialiseNetworkRules()
           else
-            showMessage "...#{url} added successfully."
-            new RuleSet $("network"), url, items[key], items[successKey]
+            chrome.storage.sync.get [ key, successKey ], (items) ->
+              showMessage "...#{url} added successfully."
+              new RuleSet $("network"), url, items[key], items[successKey]
 
 Common.documentReady ->
   chrome.storage.sync.get null, (items) ->

    showButton = element.querySelector(".container-show")

    removeButton.addEventListener "click", ->
      removeButton.style.color = "Red"
      if confirm "Are you sure you want to remove this these rules?"
        wrapper.style.display = "none"

    urlElement = $("add-network-text")
    urlElement.value = localStorage.previousUrl

    addButton = $("add-network-button")
    addButton.addEventListener "click", ->
      addButton.blur()
      fetchUrl()
    urlElement.addEventListener "keydown", (event) ->
      fetchUrl() if event.keyCode == 13

