fix index construction