Trying to get input from a .txt file, and put it in a doubly linked list

ApeOut :

I'm trying to get input from a .txt file, and put it in a doubly linked list in alphabetical order. However some of the names of the .txt file eventually do go in and somehow disappear from the doubly linkedlist? the .sort() function in the insert function in the main is supposed to sort the names in alphabetical order, and yet sometimes it doesn't put the names in Alphabetical order. How can I solve this issue?

Thank you :)

Main method

import java.util.*;
import java.io.*;
class Main 
{
  public static void main(String[] args) throws FileNotFoundException 
  {
    DLL dub = new DLL();
    dub=insert("input.txt");
    dub.traverse();
  }
  public static DLL insert(String fileName) throws FileNotFoundException // gets input from .txt file
  {
    DLL list = new DLL();
    try(Scanner file = new Scanner(new File(fileName)))
    {
      while(file.hasNextLine())
      {
        String line = file.nextLine();
        if(line.startsWith("delete ")) // if .txt contains delete then delete then find the word from the DLL, and remove it
        {
          String element = line.substring("delete ".length());
          list.remove(element);
          continue;
        }
        list.add(line);
      }
      list.sort();
    }
    return list;
  }
}

Doubly Linked List Class #

import java.io.*;
import java.util.*;
public class DLL
{
  private Node head;
  private Node tail;
  /******************************************************************/
  public void traverse() // this method displays the DLL traversing forward and backward
  {
    System.out.println();
    for(Node n=head; n!=null; n=n.getNext()) // traverses forwards
    {
      System.out.println(n.getValue());
    }
    System.out.println("==========");
    for(Node n=tail; n!=null; n=n.getPrev()) // traverses backwards
    {
      System.out.println(n.getValue());
    }
  }
  /******************************************************************/
  public void add(String line) // this method adds a name into the doubly linked list 
  {
    Node newNode = new Node(line); // creates a new node 
    if(head==null) //if the head is null set the head and tail equal to the new node 
    {
      head=newNode;
      tail=newNode;
    }
    else // otherwise, add the tail at the end 
    {
      newNode.setPrev(tail);
      tail.setNext(newNode);
      tail=newNode;
    }
  }
  /******************************************************************/
  public void remove(String line) // removes a node 
  {
    Node nodeToDelete = find(line); // checks to see if node is available
    removeNode(nodeToDelete); // remove the node 
  }
  /******************************************************************/
  private Node find(String element) // this method checks to see if the name is available 
  {
    Node curr = head;
    if(curr==null) // if the node is empty, then make the program crash
    {
      throw new IllegalStateException("LinkedList is empty.");
    }
    while(curr!=null) // otherwise, traverse through the program
    {
      if(curr.getValue().equals(element))
      {
        return curr;
      }
      curr=curr.getNext();
    }
    if(curr==null) // if element cant be found then throw an exception
    {
      throw new IllegalStateException("Element was not found.");
    }
    return null; // returns nothing 
  }
  /******************************************************************/
  public Node findSmallest() // this method finds 
  {
    Node curr = head;
    if(curr==null)
    {
      throw new IllegalStateException("LinkedList is empty.");
    }
   String smallestElement = curr.getValue();
   Node smallestNode=curr;
   while(curr!=null)
   {
      if(smallestElement.compareTo(curr.getValue())<0)
      {
        smallestNode=curr;
        smallestElement = smallestNode.getValue();      
      }
      curr=curr.getNext();    
   }
    return smallestNode;
  }
  /******************************************************************/
  public void removeNode(Node nodeToDelete)
  {
    Node prev = nodeToDelete.getPrev();
    Node next = nodeToDelete.getNext();

    if(prev == null && next == null) // case to remove an item with no previous or next 
    {
      head=null;
      tail=null;
    }
    else if(prev==null) // case to remove a name that happens to be at the head 
    {
      head=next;
      head.setPrev(null);
    }
    else if(tail.getNext()==null) // case to remove a name that happens to be at the tail
    {
      tail=prev;
      tail.setNext(null);
    }
    else // otherwise remove the node in-between
    {
      prev.setNext(next);
      next.setPrev(prev);
    }
  }
  /******************************************************************/
  public boolean isEmpty()
  {
    return head==null;
  }
  /******************************************************************/
  public void sort()
  {
    DLL sorted = new DLL();
    if(isEmpty())
    {
      return;
    }    
    while (!isEmpty()) 
    {
      Node smallest = findSmallest();
      sorted.add(smallest.getValue());
      remove(smallest.getValue());
    }
    head = sorted.head;
    tail = sorted.tail;
  }
}

Node Class #

public class Node
{
  private Node prev;
  private Node next;
  private String name;
  Node(String name) // constructor
  {
    this.name=name;
  }
  public String getValue() // this function returns the name 
  {
    return this.name;
  }
  public void setValue(String name) // this function changes the value
  {
    this.name=name;
  }
  public Node getNext() // this function returns the previous node 
  {
    return this.next;
  }
  public Node getPrev() // this function returns the previous node 
  {
    return this.prev;
  }

  public void setNext(Node next) // this function sets the next node
  {
    this.next=next;
  }

  public void setPrev(Node prev) // this function sets the previous node
  {
    this.prev=prev;
  }
}

input.txt file #

Jim
Jill
John
Louis
delete Jill
Bob
Jack
delete Jim

Output I get #

Jack
Bob
=========
Bob
Jack

Output I expect

Bob
Jack
John
Louis 
=========
Louis 
John
Jack 
Bob