fixed more than 3 pages showing up in pagination