correct before/after search-text change detection