added typeof undefined