lock-detection written