diff --git a/src/util/pureConstant.service.ts b/src/util/pureConstant.service.ts
index 8a6f267da5ef0d83769167598ab3879634405874..18602a9e6e5f5ff5fed3f5877fb3586cac054c41 100644
--- a/src/util/pureConstant.service.ts
+++ b/src/util/pureConstant.service.ts
@@ -530,7 +530,7 @@ Raise/track issues at github repo: <a target = "_blank" href = "${this.repoUrl}"
   //ToDo improve the readability
   private ngLayerObj: NgLayerObj = {}
 
-  getNehubaConfigFromTemplateId(atlasId: string, templateId: string) {
+  getNehubaConfigFromAtlasTmplIds(atlasId: string, templateId: string) {
     const atlasLayers = this.ngLayerObj[atlasId]
     const templateLayers = atlasLayers && atlasLayers[templateId]
     return templateLayers || {}
diff --git a/src/viewerModule/nehuba/viewerCtrl/viewerCtrlCmp/viewerCtrlCmp.component.ts b/src/viewerModule/nehuba/viewerCtrl/viewerCtrlCmp/viewerCtrlCmp.component.ts
index 4a8da647e17b810e205ac3c13a115de18db186d6..552003e284993325262e97b766b337c796486c58 100644
--- a/src/viewerModule/nehuba/viewerCtrl/viewerCtrlCmp/viewerCtrlCmp.component.ts
+++ b/src/viewerModule/nehuba/viewerCtrl/viewerCtrlCmp/viewerCtrlCmp.component.ts
@@ -162,15 +162,14 @@ export class ViewerCtrlCmp{
   }
 
   private toggleParcVsbl(){
-    const visibleParcLayers = ((window as any).viewer.layerManager.managedLayers)
-      .slice(1)
-      .filter(({ visible }) => visible)
-
-      .filter(l => {
-        const layers = this.pureConstantService.getNehubaConfigFromTemplateId(this.selectedAtlasId, this.selectedTemplateId)
-        return layers && Object.keys(layers).includes(l.name)
-      })
-      .filter(layer => !this.auxMeshesNamesSet.has(layer.name))
+    const templateLayers = this.pureConstantService.getNehubaConfigFromAtlasTmplIds(this.selectedAtlasId, this.selectedTemplateId)
+    const visibleParcLayers = templateLayers?
+      ((window as any).viewer.layerManager.managedLayers)
+        .slice(1)
+        .filter(({ visible }) => visible)
+        .filter(l => Object.keys(templateLayers).includes(l.name))
+        .filter(layer => !this.auxMeshesNamesSet.has(layer.name))
+      : []
 
     if (this.flagDelin) {
       for (const name of this.hiddenLayerNames) {