Fix mem leak for toggle entry index