the function of register is finished