Fixed a typo in get_parent function