bugfix in reasoning about object detections: avoid race condition