fix a totalpage count bug