fix to have metadata as array