bugfix: was not assigning parents properly