small improvement in register protecting