private static String checkValidShortName(String shortname) {
        String message = "";
        boolean valid = false;
        if(shortname == null || shortname.equals("") || !ModPack.isValidKey(shortname)) {
            message = "Shortname is not valid, pick a new key";
        } else if(Globals.getInstance().listsPacks.shortnameExists(shortname)) {
            message = "Shortname exists, pick a new shortname\nIf you want to overwrite the shortname, press ok without changing the shortname";
            valid = true;
        }
        if(!message.equals("")) {
            String result = (String) JOptionPane.showInputDialog(
                    Globals.getInstance().mainFrame, message,
                    "New shortname", JOptionPane.PLAIN_MESSAGE, null, null, shortname);
            if(result == null) return null;
            if(valid && result.equals(shortname)) {
                int n = JOptionPane.showConfirmDialog(
                        Globals.getInstance().mainFrame,
                        "Are you sure you want to overwrite the shortname \""+shortname+"\"?",
                        "Confirm overwrite",
                        JOptionPane.YES_NO_OPTION);
                if(n == JOptionPane.YES_OPTION) {
                    return shortname;
                } else {
                    return null;
                }
            }
            return checkValidShortName(result);
        }
        return shortname;
    }