fixed wrong index