Added parentroot check