Add detaching the lock