finish the template