fix register function error