Added another condition to check if infinite scroll must be loaded.