use global in outer function