     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)
     }
 }
 

        Logger.syncLogger.newLogWithDate(NSDate())

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

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

        self.tabManager = TabManager(defaultNewTabRequest: defaultRequest, prefs: profile.prefs, imageStore: imageStore)
        self.tabManager.stateDelegate = self

        // Add restoration class, the factory that will return the ViewController we
        // will restore with.
        log.debug("Initing BVC…")

        browserViewController = BrowserViewController(profile: self.profile!, tabManager: self.tabManager)
        browserViewController.restorationIdentifier = NSStringFromClass(BrowserViewController.self)
        browserViewController.restorationClass = AppDelegate.self
        browserViewController.automaticallyAdjustsScrollViewInsets = false
