fix register scope