updates to fix setIndexDirect