fixed bug when replacing with strings containing quotes