         chrome.storage.sync.get PROJECT, (projects) ->
           if chrome.runtime.lastError? then callback? null; return
 
-          tmp = []
-          for t in tickets[TICKET]
-            tmp.push {
-              id:      t[TICKET_ID]
-              subject: t[TICKET_SUBJECT]
-              url:   t[TICKET_PRJ_URL]
-              project:
-                id:    t[TICKET_PRJ_ID]
-                name:  projects[PROJECT][t[TICKET_PRJ_URL]][t[TICKET_PRJ_ID]]
-              show:    t[TICKET_SHOW]
-            }
-
-          callback? tmp
+          chrome.storage.sync.get INDEX, (index) ->
+            if chrome.runtime.lastError? then callback? null; return
+            if not (tickets[TICKET]? and index[INDEX]? and projects[PROJECT]?)
+              callback? null
+              return
+
+            tmp = []
+            for t in tickets[TICKET]
+              url = index[INDEX][t[TICKET_URL_INDEX]]
+              tmp.push {
+                id:      t[TICKET_ID]
+                subject: t[TICKET_SUBJECT]
+                url:     url
+                project:
+                  id:    t[TICKET_PRJ_ID]
+                  name:  projects[PROJECT][url][t[TICKET_PRJ_ID]]
+                show:    t[TICKET_SHOW]
+              }
+
+            callback? tmp
 
 
     ###

  #
  # - in chrome sync,
  #
  #     ticket = [ id, subject, project_url, project_id, show ]
  #



    ###
    sync: (callback) ->

      urlIndex = []
      projectObj = {}
      for t in tickets
        projectObj[t.url] = projectObj[t.url] or {}
        projectObj[t.url][t.project.id] = t.project.name
      for url, v of projectObj
        urlIndex.push url
      ticketArray = []
      for t in tickets
        for url, i in urlIndex when url is t.url then index = i
        ticketArray.push [t.id, t.subject, index, t.project.id, t.show]

      chrome.storage.sync.set PROJECT: projectObj
      chrome.storage.sync.set INDEX: urlIndex
      chrome.storage.sync.set TICKET: ticketArray, () ->
        if chrome.runtime.lastError?
          callback? false
        else
          callback? true

  }
)
