implement detect_stolen_lock logic + changes to warn()