fixed ApplyDetector + test