fix for query replace fontification issue