migrate detect_res