fix sync_file