         
         queue.name = "TileDownloadQueue"
         queue.maxConcurrentOperationCount = 1
+        
+        startBackgroundTask()
         
         queue.addOperation {
             

    
    // - All about tiles downloading -
    
    fileprivate func transformWorldCoordinateToTilePathForZoom(_ zoom: Int, lon: Double, lat : Double) -> (x: Int, y: Int) {
        
        let midtileX = floor((lon + 180.0) / 360.0 * pow(2.0, Double(zoom)))

                            
                            self.stopDownloading()
                            
                            self.stopBackgroundTask()
                            
                            let alertController = UIAlertController (title: "Thank you!", message: "Maps will be switched automatically once you will be offline", preferredStyle: .alert)
                            
                            let action = UIAlertAction(title:"Ok", style: .default) { (_) -> Void in
