index bugs fix