finally fix index issue