better metadata checking