fix bugs in naming the files