lock more defensively