improve error message when registering an object with an uninitialized monitor field