tooltype, index null bug fix