fix index repeat problem