fix double replacement rule