Fix db connection issues