Fix wrong index creation