ADDED isValid method