fix register issue,use length to replace size