Changes to infinite scrolling code