#17 use correct variable name in undefined check