fix bug in view register