Fixed index error that broke pagination