public String next() throws IOException {
        if (hasNext()) {
            String filename = tempdir + (File.separator) + nextSessionId() + ".avi";
            names.add(filename);
            ++currindex;
            return names.get(currindex - 1);
        }
        throw new NoSuchElementException();
	}