Fixing bugs related to withdraw script in tokens record