use typeof undefined check instead