Checking for undef instead of null