fix parallel detection ordering issue, produce correct result all the times