 											for i in [result.length-1..0]
 												newItems.unshift (insert --first, result[i])
 											#log "prepended: requested #{bufferSize} received #{result.length} buffer size #{buffer.length} first #{first} next #{next}"
-										finalize(rid, scrolling, newItems)
-
-						resizeHandler = ->
+										finalize(rid, newItems)
+
+						resizeAndResizeHandler = ->
 							if !$rootScope.$$phase && !isLoading
-								adjustBuffer(null, false) #todo dhilt : is null rid passing safe for resize, scroll, delete and insert cases?
+								adjustBuffer()
 								$scope.$apply()
 
-						viewport.bind 'resize', resizeHandler
-
-						scrollHandler = ->
-							if !$rootScope.$$phase && !isLoading
-								adjustBuffer(null, true)
-								$scope.$apply()
-
-						viewport.bind 'scroll', scrollHandler
+						viewport.bind 'resize', resizeAndResizeHandler
+						viewport.bind 'scroll', resizeAndResizeHandler
 
 						wheelHandler = (event) ->
 							scrollTop = viewport[0].scrollTop

											rowTop = itemTop
									for row in rows
										adjustRowHeight(row.appended, row.wrapper)
									doAdjustment(rid, scrolling, finalize)
							else
								doAdjustment(rid, scrolling, finalize)

						finalize = (rid, scrolling, newItems)->
							adjustBuffer rid, scrolling, newItems, ->
								pending.shift()
								if pending.length == 0
									isLoading = false
									loading(false)
								else
									fetch(rid, scrolling)

						fetch = (rid, scrolling) ->
							direction = pending[0]
							#log "Running fetch... #{{true:'bottom', false: 'top'}[direction]} pending #{pending.length}"
							if direction
								if buffer.length && !shouldLoadBottom()
									finalize(rid, scrolling)
								else
									#log "appending... requested #{bufferSize} records starting from #{next}"
									datasource.get next, bufferSize,

									next++

							item.scope.$index = first + i for item,i in buffer
							adjustBuffer(null, inserted)

		])

