Fixed Error with ForEach in pagination