++ fix bug when replacing string