change the way of getting metadata