try to fix fwrite