handle null case, as well