pagination implementation (not working)