fix incorrect search and replace