modify the detection script