diff --git a/controllets/data-sevc-controllet/data-sevc-controllet.html b/controllets/data-sevc-controllet/data-sevc-controllet.html
index 172be38..aa4a2ad 100755
--- a/controllets/data-sevc-controllet/data-sevc-controllet.html
+++ b/controllets/data-sevc-controllet/data-sevc-controllet.html
@@ -888,6 +888,8 @@ Example:
                             this.$.message.show();
                             return false;
                         }else{
+                            this.$.datalet_placeholder_2.innerHTML = "";
+                            if(this.selectedDatalet != undefined) this.injectDatalet(this.$.datalet_placeholder);
                             return true;
                         }
                     case 3:
@@ -896,6 +898,7 @@ Example:
                             this.$.message.show();
                             return false;
                         }else{
+                            this.$.datalet_placeholder.innerHTML = "";
                             this.injectDatalet(this.$.datalet_placeholder_2);
                             return true;
                         }
@@ -1028,6 +1031,7 @@ Example:
             _textElementChanged : function(e){
                 if(this.selected == 3) {
                     this.generateDataletPreview();
+                    this.$.datalet_placeholder.innerHTML = "";
                     this.injectDatalet(this.$.datalet_placeholder_2);
                 }
             },
@@ -1062,7 +1066,7 @@ Example:
                     fields :  this.selectedFields,
                     datalet : this.selectedDatalet,
                     comment : this.$.commentArea.value,
-                    staticData : JSON.stringify(this.$.datalet_placeholder.children[1].behavior.data)
+                    staticData : JSON.stringify(this.$.datalet_placeholder_2.children[1].behavior.data)
                 }
 
                 this.fire('data-sevc-controllet.dataletCreated', {data : data});
diff --git a/datalets/treemap-datalet/js/buildtreemap.js b/datalets/treemap-datalet/js/buildtreemap.js
index 6a6326c..c7dcd83 100755
--- a/datalets/treemap-datalet/js/buildtreemap.js
+++ b/datalets/treemap-datalet/js/buildtreemap.js
@@ -3,7 +3,7 @@
  */
 
 function build(root, place_holder) {
-    var plwidth = $("#" + place_holder).width(),
+    var plwidth  = $("#" + place_holder).width(),
         plheight = $("#" + place_holder).height();
 
     var margin = {top: 20, right: 0, bottom: 0, left: 0},
diff --git a/datalets/treemap-datalet/treemap-datalet.html b/datalets/treemap-datalet/treemap-datalet.html
index 028a8d3..6013287 100755
--- a/datalets/treemap-datalet/treemap-datalet.html
+++ b/datalets/treemap-datalet/treemap-datalet.html
@@ -142,7 +142,7 @@ Example:
                 this.map.children = [];
 
                 for(var i = 0; i < treemapData.length; i++){
-                    this.checkAggragationField(treemapData[i], this._component.fields.length , this._component.fields.length - 1);
+                    this.checkAggragationField(treemapData[i], this.data.length , this.data.length - 1);
                 }
 
                 var json = JSON.stringify(this.map);