match index bug fix