fix the nb of pages bug