fix replace in wrong place