modified the truncate function to used for list
new var name