fix index conditional logic
Merge branch '#43/fix-index-conditional-logic' into develop