fixing the index template to proper use the model collection