fix a register bug