fix yaml_emit_file function