                     if let siteIndex = find(sites, site) { // Use the site object to get its index position in the array.
                         AppDataManager.sharedInstance.currentSiteIndex = siteIndex
                         if let notificationIndex  = find(site.notifications, notification) {
+           
                             site.notifications.removeAtIndex(notificationIndex)
+                            AppDataManager.sharedInstance.updateSite(site)
+                            AppDataManager.sharedInstance.currentSiteIndex = siteIndex
                             // println("User tapped on notification for site: \(site) at index \(siteIndex)")
                             
                             let url = NSURL(string: "nightscouter://link/\(UIStoryboard.StoryboardViewControllerIdentifier.SiteListPageViewController.rawValue)")

        if let userInfoDict : [NSObject : AnyObject] = notification.userInfo {
            if let uuidString = userInfoDict[Site.PropertyKey.uuidKey] as? String {
                let uuid = NSUUID(UUIDString: uuidString) // Get the uuid from the notification.
                let site = sites.filter{ $0.uuid == uuid }.first // Use the uuid value to get the site object from the array.
                let siteIndex = find(sites, site!) // Use the site object to get its index position in the array.
                
                site?.notifications.removeAtIndex(find(site!.notifications, notification)!)
                AppDataManager.sharedInstance.updateSite(site!)
                AppDataManager.sharedInstance.currentSiteIndex = siteIndex!
                
                // println("User tapped on notification for site: \(site) at index \(siteIndex)")
                

        for site in sites {
            // Get settings for a given site.
            let nsApi = NightscoutAPIClient(url: site.url)
            
            for notification in UIApplication.sharedApplication().scheduledLocalNotifications as! [UILocalNotification] { // loop through notifications...
                if (notification.userInfo![Site.PropertyKey.uuidKey] as! String == site.uuid) { // ...and cancel the notification that corresponds to this TodoItem instance (matched by UUID)
                    UIApplication.sharedApplication().cancelLocalNotification(notification) // there should be a maximum of one match on UUID
                    break
                }
            }

            
            nsApi.fetchServerConfiguration { (result) -> Void in
                switch (result) {
