fixed a flag used when opening file