bug to fix tomorrow, undefined class in index affecting .each