Fixed a coding mistake:

if(typeof something !== undefined) --> if(typeof something !== 'undefined')