fixed mis-counted number of pages