reverted changes to isValid