[BUGFIX] wrong check for 'undefined' in js