global vars must be refs