Fixed pagination implementation