add index and directory