improved checking whether db is set