update metadata function WIP