reloading document, updating template