tweak null check handling