an inelegant solution to limiting pages shown