fixed crucial register bug