fix empty db issue