Fix variable redeclaration bug.

`db` was being redeclared in the local scope of `loadDB` and therefore the global `db` was never initialized.
No need to pass global as argument.