fixed: closing of last document