fix register bug