   # Export useful things
   myRepl.context[key] = value for key, value of {client, delay, program, echoDone, runJs, runJsFile}
   myRepl.on 'exit', ->
-    mainMenu()
+    callback()
 
 mainMenu = ->
   accountList = null

        next()
    waitABit: (next) ->
      delay 3000, next
    downloadAllPreviousStatements: (next) ->
      downloader = new PreviousStatementsDownloader "#{__dirname}/statement-#{slug(chosenAccount.details)}.json"
      downloader.downloadAll next
  , (err) ->
    return handleError err if err

    console.log "What would you like to do now?"
    options = [
      'REPL'
      'exit'
    ]
    program.choose options, (i) ->
      process.stdin.pause()
      switch options[i]
        when 'REPL'
          console.log "Switching to #{"REPL".bold} mode..."
          repl()
        else
          console.log "Exiting..."

login = ->
  async.series

  else
    console.log "Done, result is in `lastResult` variable."

repl = (callback = mainMenu) ->
  options =
    prompt: "HSBCScrape REPL> "
    useGlobal: true
