add index of directive