needed fix for 'undefined' error