apply template is done