corrected template mapping