fixed bug in autoRegister after refactor