Texture issue with cloned entity

Hello, i have this code:

if (this.entity.script.Game.idDungeon===0) {
                if (newWall.model.model) { //check if there's a model
                    newWall.model.model.meshInstances[0].material=app.assets.find('MossyWall','material').resources[0];
} else {
                    // to do with entity with child models
}
}

the problem is when i descend to dungeon and the walls are generated the ones that appears at once doesn’t have the model.model.meshinstances but model.entity.model.entity.model (endlessly)…why is that? ah btw…the walls that are visualized when the player move (same code) works fine