fixed a bug in createFile