update to support cast from data to metadata