validating with help from metadata class