diff --git a/animation_rotobezier.py b/animation_rotobezier.py
index 92ae49d811f5a9bce6f283fcb339834b0437e21a..c49a72eb83c4dfec6a2cdfaf06b3986b8f0d8d7a 100644
--- a/animation_rotobezier.py
+++ b/animation_rotobezier.py
@@ -231,14 +231,6 @@ def MakeMatte (Type):
     Obj = bpy.context.active_object
     
     # Material
-    def CheckMat (MatName):
-        Result = False
-        Mats = bpy.data.materials
-        for Mat in Mats:
-            if Mat.name == MatName:
-                Result = not Result
-        
-        return Result
     
     if Type == 'White':
         MatName = 'RotoBezier_WhiteMatte'
@@ -248,7 +240,7 @@ def MakeMatte (Type):
         MatName = 'RotoBezier_BlackMatte'
         MatCol = (0,0,0)
 
-    if CheckMat(MatName):
+    if bpy.data.materials.get(MatName):
         Mat = bpy.data.materials[MatName]
         if not Obj.material_slots:
             bpy.ops.object.material_slot_add()