fix index problems