fixed file IO