update the register method