limit to valid page numbers