fixed a file creation bug