fixed overlapping patterns in Transformer