close document