fixing isValid test