fixed getParent() method