more work on document locking