Proposed fix for the activedocument management.