fix previous commits (recursive isValid is not necessary)