Added logging around locking