Move DB connect to a global variable.