renamed valid to isValid