             var y_texture: Unmanaged<CVMetalTexture>?
             let y_width = CVPixelBufferGetWidthOfPlane(pixelBuffer, 0)
             let y_height = CVPixelBufferGetHeightOfPlane(pixelBuffer, 0)
-            CVMetalTextureCacheCreateTextureFromImage(kCFAllocatorDefault, _textureCache, pixelBuffer, nil, MTLPixelFormat.R8Unorm, y_width, y_height, 0, &y_texture)
+            CVMetalTextureCacheCreateTextureFromImage(kCFAllocatorDefault, textureCache, pixelBuffer, nil, MTLPixelFormat.R8Unorm, y_width, y_height, 0, &y_texture)
             
             var uv_texture: Unmanaged<CVMetalTexture>?
             let uv_width = CVPixelBufferGetWidthOfPlane(pixelBuffer, 1)
             let uv_height = CVPixelBufferGetHeightOfPlane(pixelBuffer, 1)
-            CVMetalTextureCacheCreateTextureFromImage(kCFAllocatorDefault, _textureCache, pixelBuffer, nil, MTLPixelFormat.RG8Unorm, uv_width, uv_height, 1, &uv_texture)
-            
-            let luma = CVMetalTextureGetTexture(y_texture!.takeRetainedValue())!
-            let chroma = CVMetalTextureGetTexture(uv_texture!.takeRetainedValue())!
+            CVMetalTextureCacheCreateTextureFromImage(kCFAllocatorDefault, textureCache, pixelBuffer, nil, MTLPixelFormat.RG8Unorm, uv_width, uv_height, 1, &uv_texture)
+            
+            guard let yTexture = y_texture, let uvTexture = uv_texture else {
+                    return
+            }
+            
+            let luma = CVMetalTextureGetTexture(yTexture.takeRetainedValue())!
+            let chroma = CVMetalTextureGetTexture(uvTexture.takeRetainedValue())!
             
             let yuvTextures:[MTLTexture] = [ luma, chroma ]
             
             // create the YUV->RGB pass
             createRenderPass(commandBuffer,
-                             pipeline: _currentColorFilter,
+                             pipeline: currentColorFilter,
                              vertexIndex: 0,
                              fragmentBuffers: [colorArgs.bufferAndOffsetForElement(_currentColorBuffer)],
                              sourceTextures: yuvTextures,
-                             descriptor: _rgbDescriptor,
+                             descriptor: rgbDescriptor,
                              viewport: nil)
             
-            CVMetalTextureCacheFlush(_textureCache, 0)
+            CVMetalTextureCacheFlush(textureCache, 0)
             
         }
     }

        }
    }
    
    private var _controller:UIViewController! = nil
    
    lazy private var _device = MTLCreateSystemDefaultDevice()
    lazy private var _vertexStart = [UIInterfaceOrientation : Int]()

    }
    
    func setBlurBuffer() {
        
        //
        // Texel offset generation for linear sampled gaussian blur
        // Source: http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/
