fix for matching parent in `getParent` function