fix query null bug