change query for check archives and template update