move address var into looping function