fix bug when no db exist