save yaml data with safe_yaml