updated page counting