fix the null bug