     }
     
     func saveCurrentTime() {
+        guard isCountingTime else {
+            return
+        }
+        
         timeBeforePause = NSDate()
         NSLog("Time before paused: \(timeBeforePause)")
         stopTimer()

        let currentTime = NSDate()
        NSLog("Time at resume: \(currentTime)")
        let interval = currentTime.timeIntervalSince(timeBeforePause! as Date) as Double
        circularSlider.endPointValue = circularSlider.endPointValue - CGFloat(interval / 60)
        operateTimer()
    }

}

    var goalFailed = false
    var backgroundTask: UIBackgroundTaskIdentifier = UIBackgroundTaskInvalid
    var timeBeforePause: NSDate?
    var userTargetTime = 0
    
    override func viewDidLoad() {
        super.viewDidLoad()
