nesting issue fix for minLength() and maxLength()