further fix to template to get key names right