         @_history.historySelect.push savedSel
         # save scrollbar position
         savedScroll =
-            xcoord: @editorBody$.scrollTop()
-            ycoord: @editorBody$.scrollLeft()
+            xcoord: @linesDiv.scrollTop
+            ycoord: @linesDiv.scrollLeft
         @_history.historyScroll.push savedScroll
         # save newPosition flag
         @_history.historyPos.push @newPosition

            savedSel = @_history.historySelect[@_history.index]
            rangy.deserializeSelection savedSel, @linesDiv
            # 2 - restore scrollbar position
            xcoord = @_history.historyScroll[@_history.index].xcoord
            ycoord = @_history.historyScroll[@_history.index].ycoord
            @editorBody$.scrollTop(xcoord)
            @editorBody$.scrollLeft(ycoord)
            # 3 - restore the lines structure
            @_readHtml()
            # 4 - update the index

            # 3 - restore scrollbar position
            xcoord = @_history.historyScroll[@_history.index+1].xcoord
            ycoord = @_history.historyScroll[@_history.index+1].ycoord
            @linesDiv.scrollTop = xcoord
            @linesDiv.scrollLeft = ycoord
            # 4 - restore lines structure
            @_readHtml()

