Added method isValid()