Update detector.cpp