   if debug
     require('electron-debug')({ showDevTools: true })
 
-# prevent window being garbage collected
-mainWindow = undefined
 
 LOGIN = "login"
 BOUND = "bound"
 PROXY_AUTH = "proxy_auth"
 DEFAULT_BOUNDS = { width: 250, height: 550 }
 
+# prevent window being garbage collected
+_mainWindow = undefined
 _bound = {}
 _event = {}
 _triedSavedAccount = false
+
 
 ###*
  On closed listener.

]

exports.openDevTools = () ->
  if mainWindow?
    mainWindow.webContents.openDevTools()

###*
 @callback onInputEndListener

 Save bounds of main window to storage.
###
saveWindowBounds = (callback) ->
  return if not _mainWindow?
  bound = _mainWindow.getContentBounds()
  # console.log(bound)
  storage.set BOUND, bound, (err) ->
    if err
