fix db null issue