fix a flipped null check