         title = note_meta['title']
         console.log('Merging note [' + guid + ']')
 
-        @find_note_by_guid(guid).then (local_note) =>
-          if local_note.length == 0
+        @find_note_by_guid(guid).then (note) =>
+          if note == null
             console.log('About to add note ' + guid)
             @add_note_meta({
               guid: guid
               title: title
             })
           else
+            console.log('local note ' + guid + ' exists, updating from remote.')
             switch local_note.status
               when @NOTE_STATUS.NEW
                 console.log('[IMPOSSIBLE] remote note\'s local cache is in status NEW')

  # return: promise containing note's info
  # ------------------------------------------------------------
  fetch_remote_note: (guid) =>
    return apiClient.notes.note({id: guid}).$promise.then (data) =>
      note =
        guid: guid
        title: data.note.title
        md: data.note.md
        status: @NOTE_STATUS.SYNCED_ALL
        resources: data.note.resources
      @update_note(note)
      return note

  # ------------------------------------------------------------
  # Load remote note list to update local notes info

                })
              when @NOTE_STATUS.SYNCED_ALL
                # fetch the whole note from server and update local
                @fetch_remote_note(guid).then(
                  (data) =>
                    note =
                      guid: data.note.guid
                      title: data.note.title
                      md: data.note.md
                    @update_note(note)
                    # TODO @update_image_manager
                  (error) =>
                    alert('fetch note ' + guid + ' failed during _merge_remote_notess():' + JSON.stringify(error))
                )
              when @NOTE_STATUS.MODIFIED
                # do nothing
                console.log('do nothing')
