Fixed bug in parent search