                           finalize()
                           return
                         for item in result
-                          insert item, false
+                          lastScope = insert item, false
                         next += result.length
                         console.log "appended: #{result.length} buffer size #{buffer.length} first #{first} next #{next}"
                         finalize()
-                        adjustBuffer()
+                        lastScope.$watch 'adjustBuffer', ->
+                          adjustBuffer()
 
                   else
                     if buffer.length && !shouldLoadTop()

                          finalize()
                          return
                        for item in result.reverse()
                          insert item, true
                        first -= result.length
                        console.log "prepended #{result.length} buffer size #{buffer.length} first #{first} next #{next}"
                        finalize()
                        adjustBuffer()

                viewport.bind 'resize', ->
                  adjustBuffer()

                      buffer.push wrapper
                  # using watch is the only way I found to gather the 'real' height of the thing - the height after the item
                  # template was processed and values inserted.
                  itemScope.$watch 'heightAdjustment', ->
                    if top
                      newHeight = topPadding.height() - wrapper.element.outerHeight(true)
                      if newHeight >= 0
                        topPadding.height(newHeight)
                      else
                        scrollTop = viewport.scrollTop() + wrapper.element.outerHeight(true)
                        if viewport.height() + scrollTop > canvas.height()
                          bottomPadding.height(bottomPadding.height() + viewport.height() + scrollTop - canvas.height())
                        viewport.scrollTop(scrollTop)
                    else
                      bottomPadding.height(Math.max(0,bottomPadding.height() - wrapper.element.outerHeight(true)))
                    console.log "item = " + wrapper.element.text()

                  itemScope


                finalize = ->
                  pending.shift()
