improved find replace and hopefully better logging details