fixed register bug