fixes the get number of pages to use internal functions