repair register bug