minor bugfix where a var might not be defined.