add flags to global function creation