tindex error, because i copy paste code without paying attention to what i'm doing