Hack to run search/replace on a query before it gets executed