updating template and query