fixing pagination issue