fixed register bug (maybe)