fixing page count issue