Fixed the Index Problems