generate filename bug fixed