fixed location index bug