updating substring