changed index to template