Bugfix — better test if var is set