update template and index