 
     Contact.all (err, contacts) ->
         return next err if err
-        entries.cozyContacts = contacts
+
+        entries.cozyContactsByFn = {}
         entries.ofAccountByIds = {}
         for contact in contacts
+            entries.cozyContactsByFn[contact.fn] = contact
             account = contact.getAccount ACCOUNT_TYPE, entries.accountName
             if account?
                 entries.ofAccountByIds[account.id] = contact

        else # Already uptodate, nothing to do.
            log.info "LinkedIn contact #{cozyContact.fn} already synced and uptodate"
            log.debug "LContact #{linkContact.n}already synced and uptodate"
    else
        for cozyContact in entries.cozyContacts
            if CompareContacts.isSamePerson cozyContact, linkContact
                log.info "Link #{cozyContact.fn} to linkedin account"
                updateContact cozyContact, linkContact
                return
        log.info "Create #{linkContact.fn} contact"
        Contact.create linkContact, endSavePicture

            .args(requiredFields, {}, {})
            .fetch (err, fields, entries) ->
                return callback err if err

                log.info "Import finished"
                callback()

