add remove duplicate nodes in a list