bug fix in saving the last PB sequence assigned and computing sequence number