added replace functionality while searching