If this routine is called in a scope nested deeper than one, the parent scope is not the global scope and it breaks.