cleaning up duplicated nodes.