     func mailComposeController(controller: MFMailComposeViewController, didFinishWithResult result: MFMailComposeResult, error: NSError?) {
         // Dismiss the view controller and start the app up
         controller.dismissViewControllerAnimated(true, completion: nil)
-        startApplication()
+        startApplication(application!, withLaunchOptions: self.launchOptions)
     }
 }
 


        // Short circuit the app if we want to email logs from the debug menu
        if DebugSettingsBundleOptions.emailLogsOnLaunch {
            self.window?.rootViewController = UIViewController();
            presentEmailComposerWithLogs()
            return true
        } else {
            return startApplication()
        }
    }

    private func startApplication() -> Bool {
        log.debug("Setting UA…")
        // Set the Firefox UA for browsing.
        setUserAgent()

        Logger.syncLogger.newLogWithDate(NSDate())

        log.debug("Getting profile…")
        let profile = getProfile(application)

        if !DebugSettingsBundleOptions.disableLocalWebServer {
            log.debug("Starting web server…")
