bug fixes to register