fixed fopen flag.