fixed issued with global function defs