Fix bug of sharing template.