fixed bug in infinite scrolling