Add check for Root Node to the parent function