add debug mode in DocCollection (closes #3629)