Fix the register bug