update the way the metadata is collected (use the database not script)