                 log.error "No 302" if res.statusCode isnt 302
                 log.error "No password" if not requiredFields.password?
                 log.error "No login" if not requiredFields.login?
-                next 'bad credentials'
+                return next 'bad credentials'
 
             options =
                 method: 'GET'

    # - Import overall pdf with name YYYYMM_freemobile.pdf

    isMultiline = $('div.infosConso').length > 1
    $('div.factLigne.is-hidden').each ->
        amount = $($(this).find('.montant')).text()
        amount = amount.replace '€', ''



# Small images are downloaded like a browser woulds do.
getSmallImage = (timer) ->
    (digit, callback) ->
        baseUrl = "https://mobile.free.fr/moncompte/"
        options =
            method: 'GET'
            jar: true
            url: "#{baseUrl}chiffre.php?pos=#{digit}&small=1"

        request options, (err, res, body) ->
            if err?
                return callback err
            #Timer is necessary otherwise the connection is not possible
            setTimeout callback, timer, null
