private void printToFile(List<Citation> citations) {
        File newFile;

        while (true) {
            String filename = io.getString("Name the new BibTex file (.bib is added automatically): ");
            newFile = new File(filename + ".bib");
            if (newFile.exists()) {
                io.println("A file named " + filename + ".bib already exists!");
            } else {
                try {
                    creation = new GenerateBibtex(citations, new FileOutputStream(newFile));
                    creation.start();
                    io.println("File created succesfully!");
                    break;
                } catch (FileNotFoundException e) {
                    System.out.println("Error: " + e.getMessage());
                }
            }
        }
    }