bugfix in template method