fix issue where variable was not defined.