Fixed a bug in file name creation