fix intermittent InStr failure