Modified page counter to (hopefully) work on PG