fixing pagination bug...