fixed syntax error in new local search replace function