added ability to validate nested types