issue with templates and comparator