possible fix for #271 'undefined' issue