fixed command execution after StopDetectionLoop