public void addRecord(final String data) throws Exception {

        Record rec = new Record(data);
        if (isNameExists(rec.name)) {
            remove(rec.name);
            nb_txt.remove(rec.name);
            throw new Exception("This name already exists.");
        }
        notebookCache.put(rec.name, rec);
        nb_txt.addRecord(rec.toString());

    }