correct the null check