finished re-register code