patternTrim fix