made js pivot index work