solving the case of PrevId