 
 consume = () ->
     frame = leapController.frame()
+
+    # Skip invalid frame processing
+    if(frame is null or frame.valid is false)
+        return
     frameController.processFrame(frame)
     console.log "Consumed frame ", frame.id
 

        if not frame.valid or frame.hands is null or frame.hands.length is 0
            console.log "Invalid frame or no hands detected"
        else
            @model = []
            for hand in frame.hands
                if(config.stabilize)
                    console.log "Stabilized position in use!"

                    position = hand.palmPosition                  
                palmPosition = @relative3DPosition(frame, position)
                
                pinchStrength = hand.pinchStrength
                if pinchStrength > 0
                    pinchingFinger = @findPinchingFingerType hand
                else
                    pinchingFinger = null

                handModel =
                    type : hand.type
                    extendedFingers: 
