fix creating metadata after merge with upstream
get rid of painful escaping for json string