Add global var and func