fixed NextReg method