add nullity check