update-metadata script updated to be more generic