         return next err if err
 
         if body.status? and body.status is 'error'
-            return next new Error(body.status_details)
-
-        $ = cheerio.load body
-        entries.csrfToken = $('#loginCsrfParam-login').val()
-        entries.accountName = requiredFields.login
-        log.info 'Tokens retrieved'
-        next()
+            next new Error(body.status_details)
+        else
+            $ = cheerio.load body
+            entries.csrfToken = $('#loginCsrfParam-login').val()
+            entries.accountName = requiredFields.login
+            log.info 'Tokens retrieved'
+            next()
 
 
 # Make the login request with the user inputs (login/password) and the csrf

            .args(requiredFields, {}, {})
            .fetch (err, fields, entries) ->
                return callback err if err
                log.info "Import finished"
                callback()


        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
        if entries.cozyContactsByFn[linkContact.fb]?
            log.info "Link #{cozyContact.fn} to linkedin account"
            updateContact cozyContact, linkContact
            return
        log.info "Create #{linkContact.fn} contact"
        Contact.create linkContact, endSavePicture
