fix bug in file name creation