fixed register bug.