fixed a bug with duplication of file names