fixed hasProperty call to use hasVariable which didn't seem to work