pattern trimming fix