fixed db connection issues