removed redundant line in each replace code