fixed database connection issues