Fix db connection in console app