undef doesn't equal false in logic statement