add a register method