more accurate error message in register