fix a bug pg num not correct