changes to metadata to be a str when updating db

also, it is loaded back into a dict when read from db