fix write detections