feat: fix replace function