bugfix, move root check after localSetupROOT