fixed find and replace functionality