DB should be retrieved when executing, not when the function is defined.