changed index to dnd tree