fix issues in templates