Add metadata validation in script