Added replaceSubstring