fix infinite scrolling bug