fix to file r/w