implemented the register method