diff --git a/contents/code/spirallayout.js b/contents/code/spirallayout.js
index 9308e9e933897fbcaa3af1e938801b3c429f08fb..67420fc54e08a97c02ad5f3c1280b645be39ace2 100644
--- a/contents/code/spirallayout.js
+++ b/contents/code/spirallayout.js
@@ -87,9 +87,10 @@ SpiralLayout.prototype.addTile = function() {
             newRect.width = splitX;
             break;
         }
+		this.tiles[this.tiles.length - 1].rectangle = lastRect;
         this._createTile(newRect);
     }
-    var lastRect = this.tiles[this.tiles.length - 1].rectangle;
+    //var lastRect = this.tiles[this.tiles.length - 1].rectangle;
 }
 
 SpiralLayout.prototype.removeTile = function(tileIndex) {