private void sortLevel(DefaultMutableTreeNode node)
    {
        ArrayList<DefaultMutableTreeNode> tempList = new ArrayList<DefaultMutableTreeNode>();
        HashMap<String, DefaultMutableTreeNode> map = new HashMap<String, DefaultMutableTreeNode>();
        int childC = node.getChildCount();
        for (int i = 0; i < childC; i++)
        {
            DefaultMutableTreeNode childAt = (DefaultMutableTreeNode) node.getChildAt(0);
            String key = childAt.getUserObject().toString();
            tempList.add(childAt);
            map.put(key, childAt);
            // sometimes there is a exception here, if yes try again x)
            while (true)
            {
                try
                {
                    // if the child should not have a parent break
                    if (childAt.getParent() == null)
                    {
                        break;
                    }
                    model.removeNodeFromParent(childAt);
                    break;
                } catch (Exception ex)
                {/* Ignore Exception */

                }
            }
        }
        Collections.sort(tempList, new MpqNodeComparator());
        int index = 0;
        for (DefaultMutableTreeNode s : tempList)
        {
            DefaultMutableTreeNode get = map.get(s.getUserObject().toString());
            while (true)
            {
                try
                {
                    if (get.getParent() == node)
                    {
                        break;
                    }
                    model.insertNodeInto(get, node, index);
                } catch (Exception ex)
                {
                }
            }
            sortLevel(get);
            index++;
        }
        tempList = null;
        map = null;
    }