fixed some bugs for getting results (not using tuple for string replace)