added functionality in language replace code