added preferGlobal flag