fix string replacement