add error check.  page numbering is 0-based.