diff --git a/enzevalos_iphone/AppDelegate.swift b/enzevalos_iphone/AppDelegate.swift
index e11e0291e9b5aeab7926262595d09c4b1dc9986e..d033e99416fe9fd26ad20ff6d02ee10ae7f114f2 100644
--- a/enzevalos_iphone/AppDelegate.swift
+++ b/enzevalos_iphone/AppDelegate.swift
@@ -33,6 +33,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
     var mailHandler = MailHandler()
     var orientationLock = UIInterfaceOrientationMask.allButUpsideDown
     var counterBackgroundFetch = 0
+    var start: Date = Date()
+
     
     func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
         // Override point for customization after application launch.
@@ -77,10 +79,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
 		if #available(iOS 11.0, *) {
 			QAKit.Fingertips.start()
 		}
-        // Set background fetching time interval.
-        let backgroundFetchInterval : Double = 10 //60*5  // seconds * minutes or UIApplicationBackgroundFetchIntervalMinimum
+        // Set background fetching time interval to 5 min
+        // Alternative:  UIApplicationBackgroundFetchIntervalMinimum
+        let backgroundFetchInterval : Double = 60*5  // =  seconds * minutes
         UIApplication.shared.setMinimumBackgroundFetchInterval(backgroundFetchInterval)
-        
+
         return true
     }
     
@@ -228,9 +231,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
     }
 
     func onboardingDone() {
-//        Logger.queue.async(flags: .barrier) {
-            Logger.log(onboardingState: "done")
-//        }
+        Logger.log(onboardingState: "done")
         UserDefaults.standard.set(true, forKey: "launchedBefore")
         self.window?.rootViewController = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController()
         presentInboxViewController()
@@ -239,9 +240,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
     func applicationWillResignActive(_ application: UIApplication) {
         // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
         // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
-//        Logger.queue.async(flags: .barrier) {
-            Logger.log(background: true)
-//        }
+        UIApplication.shared.applicationIconBadgeNumber = 0
+        Logger.log(background: true)
     }
 
     func applicationDidEnterBackground(_ application: UIApplication) {
@@ -347,24 +347,25 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
     }
     
     
-    
     // Support for background fetch
     func application(_ application: UIApplication, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
         counterBackgroundFetch = counterBackgroundFetch + 1
-        print("Fetch mails! #Fetches", counterBackgroundFetch )
-        mailHandler.newMails(completionCallback: hasNewMails(_:performFetchWithCompletionHandler: ), performFetchWithCompletionHandler: completionHandler)
+        start = Date()
+        mailHandler.backgroundUpdate(completionCallback: hasNewMails(_:performFetchWithCompletionHandler: ), performFetchWithCompletionHandler: completionHandler)
     }
     
-    var c = 1
     
     func hasNewMails(_ newMails: UInt32, performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void){
-        print("Have we new Mails?: ", newMails)
-        c = c + 1
-        UIApplication.shared.applicationIconBadgeNumber = Int(c)
+        let duration = Date().timeIntervalSince(start)
+        Logger.log(backgroundFetch: newMails, duration: duration)
         if newMails > 0 {
-            // UIApplication.shared.applicationIconBadgeNumber = Int(newMails)
+            UIApplication.shared.applicationIconBadgeNumber = Int(newMails)
+            completionHandler(.newData)
+        } else {
+            UIApplication.shared.applicationIconBadgeNumber = 0
+            completionHandler(.noData)
         }
-        completionHandler(.newData)
+
     }
 }
 
diff --git a/enzevalos_iphone/DataHandler.swift b/enzevalos_iphone/DataHandler.swift
index 756948f0ad0e966a824cf019bffd4313c3cae568..424806fdd455e7999182ea6d2e32c6fa0443ad7c 100644
--- a/enzevalos_iphone/DataHandler.swift
+++ b/enzevalos_iphone/DataHandler.swift
@@ -777,7 +777,7 @@ class DataHandler {
         myfolder.addToMails(mail)
         if mail.uid > myfolder.maxID {
             myfolder.maxID = mail.uid
-            print("New ID: %s", myfolder.maxID)
+            print("New ID: \( myfolder.maxID)")
         }
         var record = getKeyRecord(addr: mail.from.mailAddress, keyID: nil)
         if let signedID = mail.signedKey?.keyID {
diff --git a/enzevalos_iphone/Logger.swift b/enzevalos_iphone/Logger.swift
index f78f3c1f614f7d8c8968ed48530acb4fe69bfc18..fd133142e74f99b2df9e13cc6248da349f2ed8c6 100644
--- a/enzevalos_iphone/Logger.swift
+++ b/enzevalos_iphone/Logger.swift
@@ -625,6 +625,19 @@ class Logger {
         sendCheck()
     }
 
+    static func log(backgroundFetch newMails: UInt32, duration: Double) {
+        if !logging {
+            return
+        }
+        
+        var event = plainLogDict()
+        event["type"] = LoggingEventType.backgroundFetch.rawValue
+        event["newMails"] = Int(newMails)
+        event["duration"] = duration
+        
+        saveToDisk(json: dictToJSON(fields: event))
+    }
+    
     static func log(verify keyID: String, open: Bool, success: Bool? = nil) {
         if !logging {
             return
diff --git a/enzevalos_iphone/LoggingEventType.swift b/enzevalos_iphone/LoggingEventType.swift
index c2ded63d9cf44e87cbac678145a675ff67d186b1..271b1b7d02bdf59a5c85d4ce040a7e4172e4d921 100644
--- a/enzevalos_iphone/LoggingEventType.swift
+++ b/enzevalos_iphone/LoggingEventType.swift
@@ -61,5 +61,6 @@ enum LoggingEventType: String {
         search = "search",
         gotBitcoinMail = "gotBitcoinMail",
         onboardingPageTransition = "onboardingPageTransition",
-        onboardingState = "onboardingState"
+        onboardingState = "onboardingState",
+        backgroundFetch = "backgroundFetch"
 }
diff --git a/enzevalos_iphone/MailHandler.swift b/enzevalos_iphone/MailHandler.swift
index cb18ab92f17e193f1743818005e0e14a0aabe03f..c53fb082d3cf77b577fc7e64ead8706c4e83b9cc 100644
--- a/enzevalos_iphone/MailHandler.swift
+++ b/enzevalos_iphone/MailHandler.swift
@@ -793,20 +793,17 @@ class MailHandler {
         }
     }
     
-    func newMails(completionCallback: @escaping (_ newMails: UInt32, _ completionHandler: @escaping (UIBackgroundFetchResult) -> Void)  -> (), performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void){
+    func backgroundUpdate(completionCallback: @escaping (_ newMails: UInt32, _ completionHandler: @escaping (UIBackgroundFetchResult) -> Void)  -> (), performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void){
         let folder = DataHandler.handler.findFolder(with: INBOX)
         let folderstatus = IMAPSession.folderStatusOperation(folder.path)
-        print("Ask folder")
+        // Work only in background thread....
         var backgroundTaskID: Int?
         DispatchQueue.global(qos: .background).async {
-            print("This is run on the background queue")
             backgroundTaskID = UIApplication.shared.beginBackgroundTask (withName: "Finish Network Tasks"){
                 UIApplication.shared.endBackgroundTask(backgroundTaskID!)
                 backgroundTaskID = UIBackgroundTaskInvalid
             }
-            
             folderstatus?.start { (error, status) -> Void in
-                print("Result!")
                 guard error == nil else {
                     UIApplication.shared.endBackgroundTask(backgroundTaskID!)
                     backgroundTaskID = UIBackgroundTaskInvalid
@@ -816,11 +813,15 @@ class MailHandler {
                 if let status = status {
                     let uidValidity = status.uidValidity
                     let uid = status.uidNext
-                    let newMails = status.recentCount
-                    print("Status: ", status)
-                    print("newMails: ", newMails)
-                    let currentDateTime = Date()
-                    print(currentDateTime, " Folder maxID: ", folder.maxID)
+                    var newMails: UInt32 = 0
+                    var diff = uid.subtractingReportingOverflow(UInt32(folder.maxID))
+                    diff = diff.partialValue.subtractingReportingOverflow(1)
+                    if diff.overflow {
+                        newMails = 0
+                    }
+                    else {
+                        newMails = diff.partialValue
+                    }
                     if (uidValidity != folder.uidvalidity || folder.maxID < uid - 1) {
                         UIApplication.shared.endBackgroundTask(backgroundTaskID!)
                         backgroundTaskID = UIBackgroundTaskInvalid
diff --git a/enzevalos_iphone/PLists/enzevalos-Info.plist b/enzevalos_iphone/PLists/enzevalos-Info.plist
index 3b486a0a3c0d4cade13876c819fa92257a59637f..5e51778971c431cc6d52d9d7adde23b621b51648 100644
--- a/enzevalos_iphone/PLists/enzevalos-Info.plist
+++ b/enzevalos_iphone/PLists/enzevalos-Info.plist
@@ -17,7 +17,7 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>0.8.7</string>
+	<string>0.8.8</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleURLTypes</key>
@@ -32,7 +32,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>0.8.7</string>
+	<string>0.8.8</string>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
 	<key>NSAppTransportSecurity</key>