reimplemented match_detections