fix bug: close document