added isValid example