fixed npages bug in dupreg()