Added stopDetection