diff --git a/scripts/yocto-check-layer b/scripts/yocto-check-layer
index 8c8b4db..a580a8f 100755
--- a/scripts/yocto-check-layer
+++ b/scripts/yocto-check-layer
@@ -125,7 +125,7 @@ def main():
         return 1
 
     logger.info("Detected layers:")
-    for layer in layers:
+    for layer in layers[:]:
         if layer['type'] == LayerType.ERROR_BSP_DISTRO:
             logger.error("%s: Can't be DISTRO and BSP type at the same time."\
                      " Both conf/distro and conf/machine folders were found."\
