Adjust infinite scroll function