fixing tree logic to check full parent URL rather than just parent's name since the name is not unique