add loading document; saving fixes