Pagination fixed with new data array manipulation