Fixing document delete in session see BT#8671