         },
         jar: jar
     }, (err, httpResponse, body) ->
-            if !err and httpResponse.statusCode is 302
-                # Follow redirects to complete login
-                request {
-                    url: httpResponse.headers.location
-                    jar: jar
-                }, (err, httpResponse, body) ->
-                    if !err and httpResponse.statusCode is 200
-                        gutil.log('Successfully logged in'.green + ' as ' + "#{username}".magenta)
-                        # Pass cookie jar into callback
-                        cb(jar)
-                    else
-                        gutil.log('Request fail 1')
-                        handleRequestError(err, httpResponse)
-            else
-                gutil.log('Incorrect username/password'.red)
+        if !err and httpResponse.statusCode is 302
+            # Follow redirects to complete login
+            request {
+                url: httpResponse.headers.location
+                jar: jar
+            }, (err, httpResponse, body) ->
+                if !err and httpResponse.statusCode is 200
+                    gutil.log('Successfully logged in'.green + ' as ' + "#{username}".magenta)
+                    # Pass cookie jar into callback
+                    cb(jar)
+                else
+                    gutil.log('Request fail 1')
+                    handleRequestError(err, httpResponse)
+        else
+            gutil.log('Incorrect username/password'.red)
 
 # **logout**
 logout = (jar) ->

            }, {decodeEntites: true}

            parser.write(body)
            parser.end();

            if type is 'page'
                file = "#{dests.live.folder}/#{page}.html"

    if type is 'image'
        checkIfImageExists link, updateImageStores, tryLogout, (equal) ->
            if equal
                return
            else
                BASE_URL = "http://#{year}.igem.org/Special:Upload"
                page = link
