fix the bug that cannot register correct