Deleting duplicate element from the list