added count_stored_detections()