finished applying template