fixed index mistakes