fixing bugs on customized index