fixing pagination