!= null also covers undefined case