try to update metadata only when the type is same as before.