fix page count incorrect bug