fix replace was not replacing all occurences of matching string