fix database connection issues