fixed db connection issues + modified login