Fix num pages in pagination