fix var ordering on global variable factory