                 } else if offset.y < scrollOffsetThreshold && scrollView!.dragging && state == .Stopped {
                     state = .Triggered
                     pullingAnimation(offset)
-                } else if offset.y >= scrollOffsetThreshold && state != .Stopped {
+                } else if offset.y >= scrollOffsetThreshold && !scrollView!.dragging && state != .Stopped {
                     state = .Stopped
                 } else if (scrollView!.dragging && state == .Stopped) {
                     // pulling down

    func stopAnimating() {
        activityIndicatorView.stopAnimating()
        state = .Stopped
    }
    
    private func resetScrollViewContentInset() {

        super.willMoveToSuperview(newSuperview)
        if superview != nil && newSuperview == nil {
            let scrollView = self.superview as! UIScrollView
            if scrollView.enablePullToRefresh && isObserving {
                scrollView.removeObserver(self, forKeyPath: "contentOffset")
                scrollView.removeObserver(self, forKeyPath: "contentSize")
                scrollView.removeObserver(self, forKeyPath: "frame")
