profile was global because var was missing