Is it possible that there may be no datacenter? You might consider checking for rootFolder before .respond_to? parent