restrict close_doc in arrayctx