Add isValid method