         static var startPointOfPan: CGPoint = CGPointZero
         static var wasOpenAtStartOfPan: Bool = false
         static var wasHiddenAtStartOfPan: Bool = false
+        static var lastState : UIGestureRecognizerState = .Ended
     }
     
     func handleRightPanGesture(panGesture: UIPanGestureRecognizer) {

            addShadowToView(rightContainerView)
            setOpenWindowLevel()
        case UIGestureRecognizerState.Changed:
            
            let translation: CGPoint = panGesture.translationInView(panGesture.view!)
            rightContainerView.frame = applyRightTranslation(translation, toFrame: RightPanState.frameAtStartOfPan)

        static var startPointOfPan: CGPoint = CGPointZero
        static var wasOpenAtStartOfPan: Bool = false
        static var wasHiddenAtStartOfPan: Bool = false
        static var lastState : UIGestureRecognizerState = .Ended
    }
    
    func handleLeftPanGesture(panGesture: UIPanGestureRecognizer) {
