Fix db connections after refactoring