fix page number NaN problem