fix typeof undefined