moved index to template class
fix
fixes