ko detection and avoidance