Small bug fix on index