fix indexing for first parent