fix openFile(), closeFile()