Fix bug in pagination demo