Added validation to take metadata classes into acocunt