fix register and setting bug