added isValid()