fixes the string replace problem